-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from PrestaShop/dev
Prepare Release v4.0.0
- Loading branch information
Showing
84 changed files
with
4,792 additions
and
1,443 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name-template: v$NEXT_PATCH_VERSION | ||
tag-template: v$NEXT_PATCH_VERSION | ||
categories: | ||
- title: 🔨 Improvements | ||
label: enhancement | ||
- title: 🐛 Bug Fixes | ||
label: bug | ||
- title: 🚀 New Features | ||
label: Feature | ||
change-template: '- #$NUMBER: $TITLE by @$AUTHOR' | ||
template: | | ||
# Changes | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Build & Release draft | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
deploy: | ||
name: build dependencies & create artifact | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Install composer dependencies | ||
run: composer install --no-dev -o | ||
|
||
- name: Clean-up project | ||
uses: PrestaShopCorp/[email protected] | ||
|
||
- name: Create & upload artifact | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: ../ | ||
|
||
update_release_draft: | ||
runs-on: ubuntu-latest | ||
needs: [deploy] | ||
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' | ||
steps: | ||
- name: Download artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
|
||
- id: release_info | ||
uses: toolmantim/release-drafter@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Prepare for Release | ||
run: | | ||
cd ${{ github.event.repository.name }} | ||
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }} | ||
- name: Clean existing assets | ||
shell: bash | ||
run: | | ||
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | ||
assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'` | ||
for asset in $assets | ||
do | ||
bin/hub api -X DELETE $asset | ||
done | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to GitHub Release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.release_info.outputs.upload_url }} | ||
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip | ||
asset_name: ${{ github.event.repository.name }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: PHP tests | ||
on: [push, pull_request] | ||
jobs: | ||
php-linter: | ||
name: PHP Syntax check 5.6|7.2|7.3 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: PHP syntax checker 5.6 | ||
uses: prestashop/github-action-php-lint/5.6@master | ||
- name: PHP syntax checker 7.2 | ||
uses: prestashop/github-action-php-lint/7.2@master | ||
- name: PHP syntax checker 7.3 | ||
uses: prestashop/github-action-php-lint/7.3@master | ||
php-cs-fixer: | ||
name: PHP-CS-Fixer | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Run PHP-CS-Fixer | ||
uses: prestashopcorp/github-action-php-cs-fixer@master | ||
phpstan: | ||
name: PHPStan | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
presta-versions: ['latest', '1.7.0.3', '1.6.1.21','1.6.1.0'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Cache vendor folder | ||
uses: actions/cache@v1 | ||
with: | ||
path: vendor | ||
key: php-${{ hashFiles('composer.lock') }} | ||
|
||
- name: Cache composer folder | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.composer/cache | ||
key: php-composer-cache | ||
|
||
- run: composer install | ||
|
||
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }}) | ||
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }} | ||
|
||
- name: Select .neon file to run with PHPStan | ||
id: neon | ||
run: | | ||
PS_VERSION=$(docker exec temp-ps bash -c 'echo "$PS_VERSION"') | ||
[[ "${PS_VERSION:0:3}" != '1.7' ]] && echo ::set-output name=filename::phpstan-PS-1.6.neon || echo ::set-output name=filename::phpstan-PS-1.7.neon | ||
- name : Run PHPStan | ||
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/${{steps.neon.outputs.filename}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
vendor/ | ||
.php_cs.cache | ||
.prettyci.composer.json |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
$config = new PrestaShop\CodingStandards\CsFixer\Config(); | ||
|
||
$config | ||
->setUsingCache(true) | ||
->getFinder() | ||
->in(__DIR__) | ||
->exclude('vendor'); | ||
|
||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop and Contributors | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
*/ | ||
|
||
namespace PrestaShop\Module\Ps_Googleanalytics\Database; | ||
|
||
use Db; | ||
use Ps_Googleanalytics; | ||
use Shop; | ||
|
||
class Install | ||
{ | ||
/** | ||
* @var Ps_Googleanalytics | ||
*/ | ||
private $module; | ||
|
||
public function __construct(Ps_Googleanalytics $module) | ||
{ | ||
if (Shop::isFeatureActive()) { | ||
Shop::setContext(Shop::CONTEXT_ALL); | ||
} | ||
|
||
$this->module = $module; | ||
} | ||
|
||
/** | ||
* installTables | ||
* | ||
* @return bool | ||
*/ | ||
public function installTables() | ||
{ | ||
$sql = []; | ||
|
||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ganalytics` ( | ||
`id_google_analytics` int(11) NOT NULL AUTO_INCREMENT, | ||
`id_order` int(11) NOT NULL, | ||
`id_customer` int(10) NOT NULL, | ||
`id_shop` int(11) NOT NULL, | ||
`sent` tinyint(1) DEFAULT NULL, | ||
`date_add` datetime DEFAULT NULL, | ||
PRIMARY KEY (`id_google_analytics`), | ||
KEY `id_order` (`id_order`), | ||
KEY `sent` (`sent`) | ||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'; | ||
|
||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ganalytics_data` ( | ||
`id_cart` int(11) NOT NULL, | ||
`id_shop` int(11) NOT NULL, | ||
`data` TEXT DEFAULT NULL, | ||
PRIMARY KEY (`id_cart`) | ||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8'; | ||
|
||
foreach ($sql as $query) { | ||
if (!Db::getInstance()->execute($query)) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
|
||
/** | ||
* Register Module hooks | ||
* | ||
* @return bool | ||
*/ | ||
public function registerHooks() | ||
{ | ||
return $this->module->registerHook('displayHeader') && | ||
$this->module->registerHook('displayAdminOrder') && | ||
$this->module->registerHook('displayFooter') && | ||
$this->module->registerHook('displayHome') && | ||
$this->module->registerHook('displayFooterProduct') && | ||
$this->module->registerHook('displayOrderConfirmation') && | ||
$this->module->registerHook('actionProductCancel') && | ||
$this->module->registerHook('actionCartSave') && | ||
$this->module->registerHook('displayBackOfficeHeader') && | ||
$this->module->registerHook('actionCarrierProcess'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop and Contributors | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA and Contributors | ||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) | ||
* International Registered Trademark & Property of PrestaShop SA | ||
*/ | ||
|
||
namespace PrestaShop\Module\Ps_Googleanalytics\Database; | ||
|
||
use Db; | ||
|
||
class Uninstall | ||
{ | ||
/** | ||
* uninstallTables | ||
* | ||
* @return bool | ||
*/ | ||
public function uninstallTables() | ||
{ | ||
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'ganalytics`'; | ||
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'ganalytics_data`'; | ||
|
||
foreach ($sql as $query) { | ||
if (!Db::getInstance()->execute($query)) { | ||
return false; | ||
} | ||
} | ||
|
||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* 2007-2020 PrestaShop and Contributors | ||
* | ||
* 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 [email protected] so we can send you a copy immediately. | ||
* | ||
* @author PrestaShop SA <[email protected]> | ||
* @copyright 2007-2020 PrestaShop SA and Contributors | ||
* @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 1998 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; |
Oops, something went wrong.