mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix support for phalcon and gearman
This commit is contained in:
parent
5c2618165a
commit
0135ee2ed1
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -2657,7 +2657,7 @@ async function addExtensionDarwin(extension_csv, version, pipe) {
|
||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
add_script +=
|
||||
'sh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') +
|
||||
' ' +
|
||||
extension +
|
||||
@ -2811,7 +2811,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
||||
// match 5.6gearman..7.4gearman
|
||||
case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension):
|
||||
command =
|
||||
'sh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/gearman.sh') +
|
||||
' ' +
|
||||
version +
|
||||
@ -2820,7 +2820,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
||||
// match 7.0phalcon3...7.3phalcon3 or 7.2phalcon4...7.4phalcon4
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
add_script +=
|
||||
'\nsh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/phalcon.sh') +
|
||||
' ' +
|
||||
extension +
|
||||
|
@ -98,7 +98,7 @@ export async function addExtensionDarwin(
|
||||
// match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
add_script +=
|
||||
'sh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/phalcon_darwin.sh') +
|
||||
' ' +
|
||||
extension +
|
||||
@ -267,7 +267,7 @@ export async function addExtensionLinux(
|
||||
// match 5.6gearman..7.4gearman
|
||||
case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension):
|
||||
command =
|
||||
'sh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/gearman.sh') +
|
||||
' ' +
|
||||
version +
|
||||
@ -276,7 +276,7 @@ export async function addExtensionLinux(
|
||||
// match 7.0phalcon3...7.3phalcon3 or 7.2phalcon4...7.4phalcon4
|
||||
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):
|
||||
add_script +=
|
||||
'\nsh ' +
|
||||
'\nbash ' +
|
||||
path.join(__dirname, '../src/scripts/ext/phalcon.sh') +
|
||||
' ' +
|
||||
extension +
|
||||
|
@ -36,7 +36,7 @@ tick="✓"
|
||||
cross="✗"
|
||||
|
||||
if [ "$extension_major_version" = "4" ]; then
|
||||
if [ -e "$ext_dir/psr.so" ]; then
|
||||
if [ -e "$ext_dir/psr.so" ] && ! php -m | grep -i -q -w psr; then
|
||||
echo "extension=psr.so" | sudo tee -a "$ini_file" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
@ -13,6 +13,7 @@ add_log() {
|
||||
# Function to install phalcon
|
||||
install_phalcon() {
|
||||
(
|
||||
sed -i '' '/extension.*psr/d' "$ini_file"
|
||||
brew tap shivammathur/homebrew-phalcon >/dev/null 2>&1
|
||||
brew install phalcon@"$php_version"_"$extension_major" >/dev/null 2>&1
|
||||
sudo cp /usr/local/opt/psr@"$php_version"/psr.so "$ext_dir" >/dev/null 2>&1
|
||||
@ -27,14 +28,17 @@ extension=$1
|
||||
extension_major=${extension: -1}
|
||||
php_version=$2
|
||||
semver=$(php -v | head -n 1 | cut -f 2 -d ' ')
|
||||
ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||
ini_file=$(php --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
|
||||
phalcon_version=$(php -d="extension=psr.so" -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
||||
phalcon_version=$(php -d="extension=psr.so" -d="extension=phalcon.so" -r "echo phpversion('phalcon');" 2>/dev/null | cut -d'.' -f 1)
|
||||
if php -m | grep -i -q -w psr; then
|
||||
phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" 2>/dev/null | cut -d'.' -f 1)
|
||||
fi
|
||||
if [ "$phalcon_version" != "$extension_major" ]; then
|
||||
install_phalcon
|
||||
else
|
||||
echo "extension=psr.so" >>"$ini_file"
|
||||
if ! php -m | grep -i -q -w psr; then echo "extension=psr.so" >>"$ini_file"; fi
|
||||
echo "extension=phalcon.so" >>"$ini_file"
|
||||
add_log "$tick" "$extension" "Enabled"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user