Skip to content

Instantly share code, notes, and snippets.

@westonruter
Created May 3, 2022 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonruter/d5ce0b32fa481d3f8c3d16052a338dc2 to your computer and use it in GitHub Desktop.
Save westonruter/d5ce0b32fa481d3f8c3d16052a338dc2 to your computer and use it in GitHub Desktop.
Running composer install to generate PHP 5.6-compatible autoload files
#!/bin/bash
if [ ! -e composer.json ]; then
echo "Run script from package root."
exit 1
fi
# "Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 5.6.40, please upgrade PHP or use Composer 2.2 LTS…"
docker run -it --rm --name composer-install -v "$PWD":/app -w /app php:5.6-cli-alpine sh -c "
wget -O /tmp/composer.phar https://getcomposer.org/download/latest-2.2.x/composer.phar \
&& \
php /tmp/composer.phar install
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment