2019-12-26 20:01:18 +07:00
|
|
|
extension=$1
|
2019-12-31 07:16:33 +07:00
|
|
|
extension_major=${extension: -1}
|
|
|
|
php_version=$2
|
2020-01-21 19:28:09 +07:00
|
|
|
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
|
|
|
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
|
|
|
if [ -e "$ext_dir/psr.so" ] && [ -e "$ext_dir/phalcon.so" ]; then
|
|
|
|
echo "extension=psr" >>"$ini_file"
|
|
|
|
echo "extension=phalcon" >>"$ini_file"
|
2020-02-02 16:53:02 +07:00
|
|
|
phalcon_version=$(php -d="extension=phalcon" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
2020-01-21 19:28:09 +07:00
|
|
|
if [ "$phalcon_version" != "$extension_major" ]; then
|
|
|
|
brew tap shivammathur/homebrew-phalcon
|
|
|
|
brew install phalcon@"$php_version"_"$extension_major"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
brew tap shivammathur/homebrew-phalcon
|
|
|
|
brew install phalcon@"$php_version"_"$extension_major"
|
|
|
|
fi
|