-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/29-add-nightly-support
- Loading branch information
Showing
21 changed files
with
269 additions
and
156 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 |
---|---|---|
|
@@ -8,4 +8,7 @@ | |
.scannerwork | ||
sonar-project.properties | ||
|
||
PrestaShop/ | ||
PrestaShop/ | ||
vendor/ | ||
.prestashop-tags | ||
.prestashop-minor-tags |
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
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,46 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# Install PHP extensions | ||
# @see https://olvlvl.com/2019-06-install-php-ext-source | ||
# @see https://stackoverflow.com/a/73834081 | ||
# @see https://packages.sury.org/php/dists/ | ||
|
||
error() { | ||
printf "\e[1;31m%s\e[0m" "${1:-Unknown error}" | ||
exit "${2:-1}" | ||
} | ||
|
||
[ -z "$PHP_ENV" ] && error "PHP_ENV is not set" 2 | ||
[ -z "$PHP_VERSION" ] && error "PHP_VERSION is not set" 3 | ||
|
||
PS_PHP_EXT="gd pdo_mysql zip intl fileinfo mbstring simplexml soap bcmath" | ||
PHP_GD_CONFIG="--with-jpeg --with-freetype"; | ||
|
||
if [ "7.1" = "$PHP_VERSION" ]; then | ||
PS_PHP_EXT="$PS_PHP_EXT mcrypt"; | ||
PHP_GD_CONFIG="--with-gd --with-jpeg --with-jpeg-dir --with-zlib-dir --with-freetype-dir"; | ||
elif [ "7.2" = "$PHP_VERSION" ] || [ "7.3" = "$PHP_VERSION" ]; then | ||
PHP_GD_CONFIG="--with-jpeg-dir --with-zlib-dir --with-freetype-dir"; | ||
fi | ||
|
||
# shellcheck disable=SC2086 | ||
docker-php-ext-configure gd $PHP_GD_CONFIG | ||
# shellcheck disable=SC2086 | ||
docker-php-ext-install $PS_PHP_EXT; | ||
|
||
if [ "production" = "$PHP_ENV" ]; then | ||
mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" | ||
rm -f "$PHP_INI_DIR/php.ini-development"; | ||
else | ||
mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini" | ||
rm -f "$PHP_INI_DIR/php.ini-production"; | ||
fi | ||
|
||
# Flashlight is a testinf platform, keep things simple | ||
sed -i 's/memory_limit = .*/memory_limit = -1/' "$PHP_INI_DIR/php.ini" | ||
sed -i 's/upload_max_filesize = .*/upload_max_filesize = 40M/' "$PHP_INI_DIR/php.ini" | ||
sed -i 's/post_max_size = .*/post_max_size = 40M/' "$PHP_INI_DIR/php.ini" | ||
|
||
# Remove php assets that might have been installed by package unaware of $PHP_INI_DIR | ||
rm -rf /etc/php* /usr/lib/php* |
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
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
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
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,12 @@ | ||
#!/bin/sh | ||
# | ||
# This is an init-script for prestashop-flashlight. | ||
# | ||
# Storing a folder in /var/www/html/modules is not enough to register the module | ||
# into PrestaShop, hence why we have to call the console install CLI. | ||
# | ||
set -eu | ||
|
||
cd "$PS_FOLDER" | ||
echo "* [testmodule] installing the module..." | ||
php -d memory_limit=-1 bin/console prestashop:module --no-interaction install "testmodule" |
32 changes: 32 additions & 0 deletions
32
examples/develop-a-module/modules/testmodule/composer.json
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,32 @@ | ||
{ | ||
"name": "prestashopcorp/testmodule", | ||
"description": "a simple module example", | ||
"type": "prestashop-module", | ||
"authors": [ | ||
{ | ||
"name": "Clément Désiles", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"license": "AFL-3.0", | ||
"autoload": { | ||
"classmap": [ | ||
"testmodule.php" | ||
], | ||
"psr-4": { | ||
"PrestaShop\\Module\\TestModule\\": "src/" | ||
} | ||
}, | ||
"config": { | ||
"preferred-install": "dist", | ||
"platform": { | ||
"php": "7.2.5" | ||
}, | ||
"optimize-autoloader": true, | ||
"prepend-autoloader": false, | ||
"platform-check": false | ||
}, | ||
"require": { | ||
"php": ">=7.2.5" | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
examples/develop-a-module/modules/testmodule/composer.lock
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.