Skip to content

Commit

Permalink
Merge pull request #94 from AltaPay/isolate-namespaces
Browse files Browse the repository at this point in the history
Isolate vendor dependencies
  • Loading branch information
emicha authored Jan 19, 2024
2 parents 08466ba + 41880bd commit 4ff471d
Show file tree
Hide file tree
Showing 20 changed files with 1,707 additions and 264 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
- name: Install and run PhpStan
run: |
composer install --no-interaction
vendor/bin/phpstan analyze
composer prefix-dependencies
php ./vendor/bin/phpstan analyze
working-directory: wordpress/wp-content/plugins/plugin-wordpress

- name: Install PHP 7.4
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [3.5.6]
- Isolate vendor dependencies to resolve conflicts with other plugins.
- Fix: Error on the payment page due to an invalid order.

## [3.5.5]
- Fix: Apple Pay payment mismatch issue with multi-shipping case.

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ If you wish to build your own copy, follow below steps:
- Install all the necessary dependencies.

composer install --no-dev
composer prefix-dependencies

- Finally, Activate the plugin from the plugins page.

## How to run cypress tests
Expand Down
8 changes: 4 additions & 4 deletions altapay.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* Description: Payment Gateway to use with WordPress WooCommerce
* Author: AltaPay
* Author URI: https://altapay.com
* Version: 3.5.5
* Version: 3.5.6
* Name: SDM_Altapay
* WC requires at least: 3.9.0
* WC tested up to: 8.4.0
* WC tested up to: 8.5.1
*
* @package Altapay
*/
Expand Down Expand Up @@ -38,7 +38,7 @@
}

if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) {
define( 'ALTAPAY_PLUGIN_VERSION', '3.5.5' );
define( 'ALTAPAY_PLUGIN_VERSION', '3.5.6' );
}

// Include the autoloader, so we can dynamically include the rest of the classes.
Expand Down Expand Up @@ -475,7 +475,7 @@ function createAltapayPaymentPageCallback() {
/**
* Method for handling capture action and call back
*
* @return WP_Error
* @return void
*/
function altapayCaptureCallback() {
$utilMethods = new Util\UtilMethods();
Expand Down
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ else
fi

mkdir -p dist
rm -rf vendor
rm -rf vendor build
php$1 $(command -v composer) $composer_command --no-dev -o --no-interaction
zip dist/altapay-for-woocommerce.zip -r * -x "dist/*" "tests/*" "bin/*" "terminal-config/*" "docs/*" "docker/*" wiki.md build.sh README.md CHANGELOG.md guide.md .gitignore phpunit.xml.dist phpstan.neon.dist composer.json composer.lock composer.lock.backup @
yes | php$1 vendor/bin/php-scoper add-prefix
rsync -a build/vendor/* vendor/ && rm -rf build/
php$1 $(command -v composer) dump-autoload --working-dir ./ --classmap-authoritative
zip dist/altapay-for-woocommerce.zip -r * -x "dist/*" "tests/*" "bin/*" "terminal-config/*" "docs/*" "docker/*" wiki.md build.sh scoper.inc.php README.md CHANGELOG.md guide.md .gitignore phpunit.xml.dist phpstan.neon.dist composer.json composer.lock composer.lock.backup @

if [ -f composer.lock.backup ]; then
rm -rf composer.lock
Expand Down
2 changes: 1 addition & 1 deletion classes/core/AltapaySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Altapay\Api\Others\Payments;
use Altapay\Api\Payments\CaptureReservation;
use Exception;
use GuzzleHttp\Exception\ClientException;
use AltaPay\vendor\GuzzleHttp\Exception\ClientException;
use WC_Order;
use Altapay\Classes\Core;

Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"require": {
"php": "^7.4 || ^8.0",
"altapay/api-php":"^3.0",
"eftec/bladeone":"^4.4"
"eftec/bladeone":"^4.4",
"humbug/php-scoper": "0.17.5"
},
"require-dev": {
"phpstan/extension-installer": "^1.0",
Expand All @@ -36,5 +37,14 @@
},
"autoload-dev": {
"classmap": ["tests"]
},
"scripts": {
"prefix-dependencies": [
"vendor/bin/php-scoper add-prefix",
"rm -rf vendor",
"mv build/vendor vendor",
"rm -rf build",
"composer dump-autoload --working-dir ./ --classmap-authoritative"
]
}
}
Loading

0 comments on commit 4ff471d

Please sign in to comment.