gestion composer 1 & 2
This commit is contained in:
parent
50188f1851
commit
0390c3b474
|
@ -92,6 +92,9 @@
|
|||
"symfony/polyfill-php56": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"pre-install-cmd": [
|
||||
"php scripts/checkcomposer.php"
|
||||
],
|
||||
"auto-scripts": {
|
||||
"cache:clear": "symfony-cmd",
|
||||
"cache:clear --env=prod": "symfony-cmd",
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
$requiredVersion = 'version 1'; // La version interdite
|
||||
|
||||
$composerVersion = trim(shell_exec('COMPOSER_ALLOW_SUPERUSER=1 composer --version --no-ansi'));
|
||||
echo $composerVersion."\n";
|
||||
|
||||
if (stripos($composerVersion,$requiredVersion)===false ) {
|
||||
echo "La version de Composer $requiredVersion n'est pas autorisée" . PHP_EOL;
|
||||
echo "Veuillez mettre à jour Composer avec 'composer self-update --1'." . PHP_EOL;
|
||||
echo "Ou executez le scripts/reconfigure.sh" . PHP_EOL;
|
||||
exit(1); // Quitte avec un code d'erreur
|
||||
}
|
|
@ -28,6 +28,8 @@ fi
|
|||
|
||||
# Installation des dépendances composer
|
||||
echo COMPOSER = Install
|
||||
export COMPOSER_ALLOW_SUPERUSER=1
|
||||
composer self-update --1 --quiet
|
||||
composer install --quiet
|
||||
|
||||
php bin/console app:AppInit --env=prod
|
||||
|
|
Loading…
Reference in New Issue