From 31b81179ba45d3279da698757f214d58fc4ef48f Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:20:33 +0200 Subject: [PATCH 1/6] Rename README.md --- Readme.md => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Readme.md => README.md (100%) diff --git a/Readme.md b/README.md similarity index 100% rename from Readme.md rename to README.md From 2a45b9b5945234a6963408a196f4f3e11917be20 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:21:11 +0200 Subject: [PATCH 2/6] Added composer.lock --- composer.lock | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 composer.lock diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..b13f131 --- /dev/null +++ b/composer.lock @@ -0,0 +1,19 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "25e638f9b1c565510ad0234505e2fb85", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.2" + }, + "platform-dev": [] +} From 8f1d2c2458809e63eae3c7675e3857247f8b14b3 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:32:42 +0200 Subject: [PATCH 3/6] Added .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61ead86 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vendor From 5f7e00cef06c97308d27f8cb83fcc2b931d461fc Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:33:16 +0200 Subject: [PATCH 4/6] Add CI --- .travis.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6506634 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,69 @@ +language: node_js + +notifications: + email: + on_success: never + +jobs: + include: + - stage: "PHP" + name: "PHPStan on PS nightly and unit tests" + language: php + php: 7.2 + script: + - composer install + # PHP syntax check + - bash -c '! (find . -name "*.php" ! -path "./vendor/*" -print0 | xargs -0 -n1 -P4 php -l | grep "Parse error")' + # PHP cs fixer + # - composer run lint + # PHP Unit + # - composer run test + # PHP Stan + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:nightly + # - docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + # - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon + - stage: "PHP" + name: "PHPStan on PS 1.7.5.2" + language: php + php: 7.2 + script: + - composer install + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.5.1 + # - docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + # - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon + - stage: "PHP" + name: "PHPStan on PS 1.7.4.4" + language: php + php: 7.2 + script: + - composer install + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.4.4 + # - docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + # - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon + - stage: "PHP" + name: "PHPStan on PS 1.7.3.4" + language: php + php: 7.2 + script: + - composer install + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.3.4 + # - docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + # - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon + - stage: "PHP" + name: "PHPStan on PS 1.7.2.5" + language: php + php: 7.2 + script: + - composer install + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.2.5 + #- docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + #- docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon + - stage: "PHP" + name: "PHPStan on PS 1.7.1.2" + language: php + php: 7.2 + script: + - composer install + - docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:1.7.1.2 + # - docker exec -ti temp-ps rm -rf /var/www/html/modules/pscleaner + # - docker run --rm --volumes-from temp-ps -v $PWD:/var/www/html/modules/pscleaner -e _PS_ROOT_DIR_=/var/www/html quetzacoalt/phpstan analyse --configuration=/var/www/html/modules/pscleaner/tests/php/phpstan/phpstan.neon From 16500544ef50a0fc78ba6d935accfc81d74b6f5e Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:36:53 +0200 Subject: [PATCH 5/6] Fixed composer.json license --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d79cb19..56d6754 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "prestashop/pscleaner", "description": "PrestaShop module pscleaner", "homepage": "https://github.com/PrestaShop/pscleaner", - "license": "AFL - Academic Free License (AFL 3.0)", + "license": "AFL-3.0", "authors": [ { "name": "PrestaShop SA", From cef0c76618cfcec01fb9e56e0b5091c2a24c9175 Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Wed, 3 Jun 2020 17:37:22 +0200 Subject: [PATCH 6/6] Update license headers --- index.php | 54 +++++++++---------- pscleaner.php | 17 +++--- translations/index.php | 54 +++++++++---------- views/index.php | 48 ++++++++--------- .../admin/_configure/helpers/form/form.tpl | 46 ++++++++-------- .../admin/_configure/helpers/form/index.php | 48 ++++++++--------- .../admin/_configure/helpers/index.php | 48 ++++++++--------- views/templates/admin/_configure/index.php | 48 ++++++++--------- views/templates/admin/index.php | 48 ++++++++--------- views/templates/index.php | 48 ++++++++--------- 10 files changed, 229 insertions(+), 230 deletions(-) diff --git a/index.php b/index.php index d4ae810..fda1188 100644 --- a/index.php +++ b/index.php @@ -1,35 +1,35 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - + header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); - + header('Location: ../'); exit; diff --git a/pscleaner.php b/pscleaner.php index 5f3cb18..5b2b2b2 100644 --- a/pscleaner.php +++ b/pscleaner.php @@ -1,13 +1,13 @@ - * @copyright 2007-2019 PrestaShop SA - * @version Release: $Revision: 7060 $ - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - * International Registered Trademark & Property of PrestaShop SA + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA */ if (!defined('_CAN_LOAD_FILES_')) { diff --git a/translations/index.php b/translations/index.php index d4ae810..fda1188 100644 --- a/translations/index.php +++ b/translations/index.php @@ -1,35 +1,35 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - + header('Cache-Control: no-store, no-cache, must-revalidate'); header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); - + header('Location: ../'); exit; diff --git a/views/index.php b/views/index.php index 4ef8000..fda1188 100755 --- a/views/index.php +++ b/views/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); diff --git a/views/templates/admin/_configure/helpers/form/form.tpl b/views/templates/admin/_configure/helpers/form/form.tpl index 831cfa1..0386399 100755 --- a/views/templates/admin/_configure/helpers/form/form.tpl +++ b/views/templates/admin/_configure/helpers/form/form.tpl @@ -1,26 +1,26 @@ {* -* 2007-2019 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* 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. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA *} {extends file="helpers/form/form.tpl"} @@ -56,4 +56,4 @@ {$smarty.block.parent} {/if} -{/block} \ No newline at end of file +{/block} diff --git a/views/templates/admin/_configure/helpers/form/index.php b/views/templates/admin/_configure/helpers/form/index.php index 4ef8000..fda1188 100755 --- a/views/templates/admin/_configure/helpers/form/index.php +++ b/views/templates/admin/_configure/helpers/form/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); diff --git a/views/templates/admin/_configure/helpers/index.php b/views/templates/admin/_configure/helpers/index.php index 4ef8000..fda1188 100755 --- a/views/templates/admin/_configure/helpers/index.php +++ b/views/templates/admin/_configure/helpers/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); diff --git a/views/templates/admin/_configure/index.php b/views/templates/admin/_configure/index.php index 4ef8000..fda1188 100755 --- a/views/templates/admin/_configure/index.php +++ b/views/templates/admin/_configure/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); diff --git a/views/templates/admin/index.php b/views/templates/admin/index.php index 4ef8000..fda1188 100755 --- a/views/templates/admin/index.php +++ b/views/templates/admin/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); diff --git a/views/templates/index.php b/views/templates/index.php index 4ef8000..fda1188 100755 --- a/views/templates/index.php +++ b/views/templates/index.php @@ -1,28 +1,28 @@ -* @copyright 2007-2019 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ +/** + * 2007-2020 PrestaShop. + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * 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. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2020 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');