Fix scripts, README and examples

This commit is contained in:
Shivam Mathur
2019-10-10 17:47:17 +05:30
parent 409e055931
commit c1c0acc338
17 changed files with 87 additions and 78 deletions

View File

@ -1,5 +1,7 @@
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
brew tap exolnet/homebrew-deprecated >/dev/null 2>&1
if [ "$1" = "5.6" ] || [ "$1" = "7.0" ]; then
brew tap exolnet/homebrew-deprecated >/dev/null 2>&1
fi
brew install php@"$1" composer >/dev/null 2>&1
brew link --force --overwrite php@"$1" >/dev/null 2>&1
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
@ -8,4 +10,4 @@ sudo chmod 777 "$ini_file"
mkdir -p "$(pecl config-get ext_dir)"
composer global require hirak/prestissimo >/dev/null 2>&1
php -v
composer -V
composer -V

View File

@ -3,7 +3,6 @@ if [ "$version" != "$1" ]; then
if [ ! -e "/usr/bin/php$1" ]; then
sudo DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:ondrej/php -y >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt update -y >/dev/null 2>&1
sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
if [ "$1" != "7.4" ]; then
sudo DEBIAN_FRONTEND=noninteractive apt install -y php"$1" curl php"$1"-curl >/dev/null 2>&1
else
@ -12,21 +11,21 @@ if [ "$version" != "$1" ]; then
fi
for tool in php phar phar.phar php-cgi php-config phpize; do
if [ -e "/usr/bin/$tool$1" ]; then
sudo update-alternatives --set $tool /usr/bin/"$tool$1"
sudo update-alternatives --set $tool /usr/bin/"$tool$1" &
fi
done
fi
if [ ! -e "/usr/bin/composer" ]; then
EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)"
curl -s -L https://getcomposer.org/installer > composer-setup.php
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)" &
curl -s -L https://getcomposer.org/installer > composer-setup.php &
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" &
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
>&2 echo 'ERROR: Invalid installer signature'
else
COMPOSER_ALLOW_SUPERUSER=1
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
fi
rm composer-setup.php
fi