setup-php/src/scripts/ext/phalcon_darwin.sh

17 lines
754 B
Bash
Raw Normal View History

2019-12-26 20:01:18 +07:00
extension=$1
extension_major=${extension: -1}
php_version=$2
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)
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