From 6e4b2a08a76305b012cbb65ec041b48385fd1973 Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:29:20 +0700 Subject: [PATCH 1/8] bump minimum compat to PHP 7.1.3 n PS 1.7.7, module version to 3.0.0 --- composer.json | 2 +- composer.lock | 62 +++++++++++++++++++++++++---------------------- pagesnotfound.php | 46 +++++++++++++++-------------------- 3 files changed, 54 insertions(+), 56 deletions(-) diff --git a/composer.json b/composer.json index 3d4152d..d750ef2 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": ">=5.6.0" + "php": ">=7.1.3" }, "require-dev": { "prestashop/php-dev-tools": "^4.3" diff --git a/composer.lock b/composer.lock index 48d9cbe..c79fc88 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4cd20c8cb925e90f65efd24eaadef4af", + "content-hash": "b2bf126885cd174e0fe215d2995aa907", "packages": [], "packages-dev": [ { @@ -303,25 +303,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "v1.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", + "reference": "612a3ee5ab0d5dd97b7cf3874a6efe24325efac3", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -340,9 +344,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + "source": "https://github.com/doctrine/deprecations/tree/v1.1.1" }, - "time": "2022-05-02T15:47:09+00:00" + "time": "2023-06-03T09:27:29+00:00" }, { "name": "doctrine/lexer", @@ -513,16 +517,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.4", + "version": "v4.15.5", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290" + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/6bb5176bc4af8bcb7d926f88718db9b96a2d4290", - "reference": "6bb5176bc4af8bcb7d926f88718db9b96a2d4290", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", "shasum": "" }, "require": { @@ -563,9 +567,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.5" }, - "time": "2023-03-05T19:49:14+00:00" + "time": "2023-05-19T20:20:00+00:00" }, { "name": "php-cs-fixer/diff", @@ -1020,16 +1024,16 @@ }, { "name": "symfony/console", - "version": "v5.4.23", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", "shasum": "" }, "require": { @@ -1099,7 +1103,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.23" + "source": "https://github.com/symfony/console/tree/v5.4.24" }, "funding": [ { @@ -1115,7 +1119,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T18:47:29+00:00" + "time": "2023-05-26T05:13:16+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2117,16 +2121,16 @@ }, { "name": "symfony/process", - "version": "v5.4.23", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", + "url": "https://api.github.com/repos/symfony/process/zipball/e3c46cc5689c8782944274bb30702106ecbe3b64", + "reference": "e3c46cc5689c8782944274bb30702106ecbe3b64", "shasum": "" }, "require": { @@ -2159,7 +2163,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.23" + "source": "https://github.com/symfony/process/tree/v5.4.24" }, "funding": [ { @@ -2175,7 +2179,7 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:50:24+00:00" + "time": "2023-05-17T11:26:05+00:00" }, { "name": "symfony/service-contracts", @@ -2415,7 +2419,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.6.0" + "php": ">=7.1.3" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/pagesnotfound.php b/pagesnotfound.php index a7e9fda..7c1fe08 100644 --- a/pagesnotfound.php +++ b/pagesnotfound.php @@ -1,28 +1,22 @@ -* @copyright 2007-2016 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * Copyright since 2007 PrestaShop SA and Contributors + * PrestaShop is an International Registered Trademark & Property of PrestaShop SA + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License version 3.0 + * that is bundled with this package in the file LICENSE.md. + * It is also available through the world-wide-web at this URL: + * https://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * @author PrestaShop SA and Contributors + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 + */ if (!defined('_PS_VERSION_')) { exit; @@ -36,7 +30,7 @@ public function __construct() { $this->name = 'pagesnotfound'; $this->tab = 'administration'; - $this->version = '2.0.3'; + $this->version = '3.0.0'; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -44,7 +38,7 @@ public function __construct() $this->displayName = $this->trans('Pages not found', [], 'Modules.Pagesnotfound.Admin'); $this->description = $this->trans('Enrich your stats, display the pages requested by your visitors that could not be found.', [], 'Modules.Pagesnotfound.Admin'); - $this->ps_versions_compliancy = ['min' => '1.7.1.0', 'max' => _PS_VERSION_]; + $this->ps_versions_compliancy = ['min' => '1.7.7', 'max' => _PS_VERSION_]; } public function install() From 7353694938a4bc7ee27044c087a91163786ab48f Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:40:55 +0700 Subject: [PATCH 2/8] wipe PHP56 n PS171-PS176 out of PHPtests, add PHP82 n PS80, update GHactions to v3 --- .github/workflows/php.yml | 22 +++++++++++----------- tests/phpstan.sh | 2 +- tests/phpstan/phpstan-1.7.1.2.neon | 2 -- tests/phpstan/phpstan-1.7.2.5.neon | 2 -- tests/phpstan/phpstan-1.7.3.4.neon | 2 -- tests/phpstan/phpstan-1.7.4.4.neon | 2 -- tests/phpstan/phpstan-1.7.5.1.neon | 2 -- tests/phpstan/phpstan-1.7.6.neon | 2 -- 8 files changed, 12 insertions(+), 24 deletions(-) delete mode 100644 tests/phpstan/phpstan-1.7.1.2.neon delete mode 100644 tests/phpstan/phpstan-1.7.2.5.neon delete mode 100644 tests/phpstan/phpstan-1.7.3.4.neon delete mode 100644 tests/phpstan/phpstan-1.7.4.4.neon delete mode 100644 tests/phpstan/phpstan-1.7.5.1.neon delete mode 100644 tests/phpstan/phpstan-1.7.6.neon diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index aeb43fa..720ee22 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,14 +3,11 @@ on: [push, pull_request] jobs: # Check there is no syntax errors in the project php-linter: - name: PHP Syntax check 5.6 => 8.1 + name: PHP Syntax check 7.2 => 8.2 runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3.0.0 - - - name: PHP syntax checker 5.6 - uses: prestashop/github-action-php-lint/5.6@master + uses: actions/checkout@v3.1.0 - name: PHP syntax checker 7.2 uses: prestashop/github-action-php-lint/7.2@master @@ -27,6 +24,9 @@ jobs: - name: PHP syntax checker 8.1 uses: prestashop/github-action-php-lint/8.1@master + - name: PHP syntax checker 8.2 + uses: prestashop/github-action-php-lint/8.2@master + # Check the PHP code follow the coding standards php-cs-fixer: name: PHP-CS-Fixer @@ -38,10 +38,10 @@ jobs: php-version: '7.4' - name: Checkout - uses: actions/checkout@v3.0.0 + uses: actions/checkout@v3.1.0 - name: Cache dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: php-${{ hashFiles('composer.lock') }} @@ -58,7 +58,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - presta-versions: ['1.7.1.2', '1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6', '1.7.7', '1.7.8', 'latest'] + presta-versions: ['1.7.7', '1.7.8', '8.0', 'latest'] steps: - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -66,18 +66,18 @@ jobs: php-version: '7.4' - name: Checkout - uses: actions/checkout@v3.0.0 + uses: actions/checkout@v3.1.0 # Add vendor folder in cache to make next builds faster - name: Cache vendor folder - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: vendor key: php-${{ hashFiles('composer.lock') }} # Add composer local folder in cache to make next builds faster - name: Cache composer folder - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.composer/cache key: php-composer-cache diff --git a/tests/phpstan.sh b/tests/phpstan.sh index 901461a..d805a55 100755 --- a/tests/phpstan.sh +++ b/tests/phpstan.sh @@ -14,7 +14,7 @@ docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/presta # Clear previous instance of the module in the PrestaShop volume echo "Clear previous module" -docker exec -t temp-ps rm -rf /var/www/html/modules/pagesnotfound +docker exec -tid temp-ps rm -rf /var/www/html/modules/pagesnotfound # Run a container for PHPStan, having access to the module content and PrestaShop sources. # This tool is outside the composer.json because of the compatibility with PHP 5.6 diff --git a/tests/phpstan/phpstan-1.7.1.2.neon b/tests/phpstan/phpstan-1.7.1.2.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.1.2.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.2.5.neon b/tests/phpstan/phpstan-1.7.2.5.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.2.5.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.3.4.neon b/tests/phpstan/phpstan-1.7.3.4.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.3.4.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.4.4.neon b/tests/phpstan/phpstan-1.7.4.4.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.4.4.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.5.1.neon b/tests/phpstan/phpstan-1.7.5.1.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.5.1.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon diff --git a/tests/phpstan/phpstan-1.7.6.neon b/tests/phpstan/phpstan-1.7.6.neon deleted file mode 100644 index c604f7c..0000000 --- a/tests/phpstan/phpstan-1.7.6.neon +++ /dev/null @@ -1,2 +0,0 @@ -includes: - - %currentWorkingDirectory%/tests/phpstan/phpstan.neon From 51e50176d9ab6ff0c136c1e70da908fbf255674d Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:41:46 +0700 Subject: [PATCH 3/8] add new neon for PS80 --- tests/phpstan/phpstan-8.0.neon | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/phpstan/phpstan-8.0.neon diff --git a/tests/phpstan/phpstan-8.0.neon b/tests/phpstan/phpstan-8.0.neon new file mode 100644 index 0000000..c604f7c --- /dev/null +++ b/tests/phpstan/phpstan-8.0.neon @@ -0,0 +1,2 @@ +includes: + - %currentWorkingDirectory%/tests/phpstan/phpstan.neon From dba879922df63495fee0ac7054cd0b8b48c5db7b Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:53:34 +0700 Subject: [PATCH 4/8] php-cs-fixer --- pagesnotfound.php | 1 - 1 file changed, 1 deletion(-) diff --git a/pagesnotfound.php b/pagesnotfound.php index 7c1fe08..5692a28 100644 --- a/pagesnotfound.php +++ b/pagesnotfound.php @@ -17,7 +17,6 @@ * @copyright Since 2007 PrestaShop SA and Contributors * @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0 */ - if (!defined('_PS_VERSION_')) { exit; } From d0c56edd1820682e776321aa5de2c3709da00924 Mon Sep 17 00:00:00 2001 From: Daniel Hlavacek Date: Tue, 20 Jun 2023 09:18:09 +0200 Subject: [PATCH 5/8] Bump config.xml to 3.0.0 --- config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.xml b/config.xml index ec475b3..c1a97b4 100755 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ pagesnotfound - + From f1e105b044b40c714da9c59c47b11eacac2f4530 Mon Sep 17 00:00:00 2001 From: florine2623 <16019289+florine2623@users.noreply.github.com> Date: Thu, 6 Jul 2023 11:15:11 +0200 Subject: [PATCH 6/8] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 20dfb9c..ff6d58e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,10 @@ Enrich your stats, display the pages requested by your visitors that could not be found. +## Compatibility + +PrestaShop: `1.7.7.0` or later + ## Reporting issues You can report issues with this module in the main PrestaShop repository. [Click here to report an issue][report-issue]. From 7fb6a15878d50407f4424c44a9b4129f5fe9db3c Mon Sep 17 00:00:00 2001 From: leemyong pakvn <3759923+leemyongpakvn@users.noreply.github.com> Date: Mon, 11 Sep 2023 09:49:12 +0700 Subject: [PATCH 7/8] rm with --user root --- tests/phpstan.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpstan.sh b/tests/phpstan.sh index d805a55..69523b6 100755 --- a/tests/phpstan.sh +++ b/tests/phpstan.sh @@ -14,7 +14,7 @@ docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/presta # Clear previous instance of the module in the PrestaShop volume echo "Clear previous module" -docker exec -tid temp-ps rm -rf /var/www/html/modules/pagesnotfound +docker exec -t --user root temp-ps sh -c 'find /var/www/html/modules/pagesnotfound -type f -exec rm {} +' # Run a container for PHPStan, having access to the module content and PrestaShop sources. # This tool is outside the composer.json because of the compatibility with PHP 5.6 From 1f1a4f2e9fbd145a8ff61d53c5e34be30f6d2296 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Thu, 23 Oct 2025 17:13:01 +0100 Subject: [PATCH 8/8] Remove space before PHP tag --- upgrade/upgrade-2.0.2.php | 1 - 1 file changed, 1 deletion(-) diff --git a/upgrade/upgrade-2.0.2.php b/upgrade/upgrade-2.0.2.php index 8bd6094..4b751d3 100644 --- a/upgrade/upgrade-2.0.2.php +++ b/upgrade/upgrade-2.0.2.php @@ -1,4 +1,3 @@ -