mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 11:51:07 +07:00
Fix logs of disabled dependent extensions
Use shared_extension function on unix
This commit is contained in:
parent
8e80635955
commit
4beeea41b4
@ -102,6 +102,11 @@ check_extension() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to check if extension is shared
|
||||
shared_extension() {
|
||||
[ -e "${ext_dir:?}/$1.so" ]
|
||||
}
|
||||
|
||||
# Function to enable cached extensions.
|
||||
enable_cache_extension() {
|
||||
deps=()
|
||||
@ -129,7 +134,7 @@ enable_extension() {
|
||||
enable_extension_dependencies "$1" "$2"
|
||||
if [ -d /tmp/extcache/"$1" ]; then
|
||||
enable_cache_extension "$1" "$2"
|
||||
elif ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then
|
||||
elif ! check_extension "$1" && shared_extension "$1"; then
|
||||
echo "$2=${ext_dir:?}/$1.so" | sudo tee -a "${pecl_file:-${ini_file[@]}}" >/dev/null
|
||||
fi
|
||||
}
|
||||
@ -164,13 +169,15 @@ disable_extension_dependents() {
|
||||
disable_extension() {
|
||||
extension=$1
|
||||
if check_extension "$extension"; then
|
||||
if [ -e "${ext_dir:?}"/"$extension".so ]; then
|
||||
if shared_extension "$extension"; then
|
||||
disable_extension_helper "$extension" true
|
||||
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Disabled") ||
|
||||
add_log "${cross:?}" ":$extension" "Could not disable $extension on PHP ${semver:?}"
|
||||
else
|
||||
add_log "${cross:?}" ":$extension" "Could not disable $extension on PHP $semver as it not a shared extension"
|
||||
fi
|
||||
elif shared_extension "$extension"; then
|
||||
add_log "${tick:?}" ":$extension" "Disabled"
|
||||
else
|
||||
add_log "${tick:?}" ":$extension" "Could not find $extension on PHP $semver"
|
||||
fi
|
||||
|
@ -6,7 +6,7 @@ add_blackfire() {
|
||||
platform=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||
extension_version=$(echo "$extension" | cut -d '-' -f 2)
|
||||
blackfire_ini_file="${pecl_file:-${ini_file[@]}}"
|
||||
if [ ! -e "${ext_dir:?}/blackfire.so" ]; then
|
||||
if ! shared_extension blackfire; then
|
||||
if [ "$extension_version" = "blackfire" ]; then
|
||||
if [[ ${version:?} =~ 5.[3-6] ]]; then
|
||||
extension_version='1.50.0'
|
||||
|
@ -7,11 +7,11 @@ add_license_log() {
|
||||
|
||||
# Function to install ioncube.
|
||||
add_ioncube() {
|
||||
if [ ! -e "${ext_dir:?}/ioncube.so" ]; then
|
||||
if ! shared_extension ioncube; then
|
||||
status='Installed and enabled'
|
||||
os_name='lin' && [ "$(uname -s)" = "Darwin" ] && os_name='mac'
|
||||
get -s -n "" https://downloads.ioncube.com/loader_downloads/ioncube_loaders_"$os_name"_x86-64.tar.gz | tar -xzf - -C /tmp
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "$ext_dir/ioncube.so"
|
||||
sudo mv /tmp/ioncube/ioncube_loader_"$os_name"_"${version:?}".so "${ext_dir:?}/ioncube.so"
|
||||
fi
|
||||
echo "zend_extension=$ext_dir/ioncube.so" | sudo tee "${scan_dir:?}/00-ioncube.ini" >/dev/null 2>&1
|
||||
add_extension_log "ioncube" "$status"
|
||||
|
@ -35,7 +35,7 @@ add_client() {
|
||||
|
||||
# Function to install oci8 and pdo_oci.
|
||||
add_oci_helper() {
|
||||
if ! [ -e "${ext_dir:?}/$ext.so" ]; then
|
||||
if ! shared_extension "$ext"; then
|
||||
status='Installed and enabled'
|
||||
read -r "${ext}_LINUX_LIBS" <<< "libaio-dev"
|
||||
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config) --with-${ext/_/-}=instantclient,$oracle_client"
|
||||
|
@ -10,7 +10,7 @@ add_phalcon_helper() {
|
||||
|
||||
# Function to add phalcon3.
|
||||
add_phalcon3() {
|
||||
if [ -e "${ext_dir:?}/phalcon.so" ]; then
|
||||
if shared_extension phalcon; then
|
||||
phalcon_version=$(php -d="extension=phalcon.so" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
||||
if [ "$phalcon_version" != "$extension_major_version" ]; then
|
||||
add_phalcon_helper
|
||||
@ -24,10 +24,10 @@ add_phalcon3() {
|
||||
|
||||
# Function to add phalcon4.
|
||||
add_phalcon4() {
|
||||
if [ -e "${ext_dir:?}/psr.so" ] && ! php -m | grep -i -q -w psr; then
|
||||
if shared_extension phalcon && ! php -m | grep -i -q -w psr; then
|
||||
echo "extension=psr.so" | sudo tee -a "${ini_file:?}"
|
||||
fi
|
||||
if [ -e "$ext_dir/phalcon.so" ]; then
|
||||
if shared_extension phalcon; then
|
||||
if php -m | grep -i -q -w psr; then
|
||||
phalcon_version=$(php -d="extension=phalcon" -r "echo phpversion('phalcon');" | cut -d'.' -f 1)
|
||||
if [ "$phalcon_version" != "$extension_major_version" ]; then
|
||||
|
@ -37,7 +37,7 @@ add_pdo_extension() {
|
||||
else
|
||||
ext=$1
|
||||
ext_name=$1
|
||||
if [ -e "$ext_dir"/pdo.so ]; then
|
||||
if shared_extension pdo; then
|
||||
disable_extension_helper pdo
|
||||
echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1
|
||||
fi
|
||||
|
@ -300,6 +300,8 @@ Function Disable-Extension() {
|
||||
} else {
|
||||
Add-Log $cross ":$extension" "Could not disable $extension on PHP $($installed.FullVersion) as it not a shared extension"
|
||||
}
|
||||
} elseif(Test-Path $ext_dir\php_$extension.dll) {
|
||||
Add-Log $tick ":$extension" "Disabled"
|
||||
} else {
|
||||
Add-Log $tick ":$extension" "Could not find $extension on PHP $($installed.FullVersion)"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user