Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move QR code library to Common #3617

Merged
merged 16 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ node_modules
# Vendor handling.
/vendor

# Allow certain vendor files.
!vendor/phpqrcode

# Some people makes...
Makefile

Expand Down
4 changes: 4 additions & 0 deletions changelog/feature-TEC-5403-move-qr-code
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: feat

Move QR code library to Common [TEC-5403]
1 change: 0 additions & 1 deletion package-safelist.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
"src/**/*",
"vendor/autoload.php",
"vendor/composer/*",
"vendor/phpqrcode/**/*",
"build/**/*"
]
5 changes: 3 additions & 2 deletions src/Tickets/QR/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace TEC\Tickets\QR;

use \TEC\Common\Contracts\Provider\Controller as Controller_Contract;
use Tribe__Main as Common;

/**
* Class Controller.
Expand Down Expand Up @@ -167,7 +168,7 @@ public function bind_facade_or_error() {
* @since 5.6.7
*/
public function has_library_loaded(): bool {
return defined( 'TEC_TICKETS_QR_CACHEABLE' );
return defined( 'TEC_COMMON_QR_CACHEABLE' );
}

/**
Expand All @@ -180,7 +181,7 @@ protected function load_library(): void {
return;
}

require_once tribe( 'tickets.main' )->plugin_path . 'vendor/phpqrcode/qrlib.php';
require_once Common::instance()->plugin_path . 'vendor/phpqrcode/qrlib.php';
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Tickets/QR/QR.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace TEC\Tickets\QR;

use TEC\Tickets\phpqrcode\QRcode;
use TEC\Common\phpqrcode\QRcode;

/**
* A Facade for the QR code generator.
Expand All @@ -19,7 +19,7 @@ class QR {
*
* @var int What type of error correction will be used on the QR code.
*/
protected $level = TEC_TICKETS_QR_ECLEVEL_L;
protected $level = TEC_COMMON_QR_ECLEVEL_L;

/**
* The size of the QR code.
Expand Down
2 changes: 1 addition & 1 deletion src/resources/postcss/utilities
Submodule utilities updated 0 files
165 changes: 0 additions & 165 deletions vendor/phpqrcode/LICENSE

This file was deleted.

Loading
Loading