mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Fix pdo setup
This commit is contained in:
parent
36ec0200a6
commit
86e1ccdd8d
@ -11,7 +11,7 @@ self_hosted_helper() {
|
|||||||
remove_extension() {
|
remove_extension() {
|
||||||
extension=$1
|
extension=$1
|
||||||
if check_extension "$extension"; then
|
if check_extension "$extension"; then
|
||||||
sudo sed -Ei '' "/=(.*\/)?\"?$extension/d" "${ini_file:?}"
|
sudo sed -Ei '' "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file:?}"
|
||||||
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
|
sudo rm -rf "${scan_dir:?}"/*"$extension"* "${ext_dir:?}"/"$extension".so >/dev/null 2>&1
|
||||||
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
|
||||||
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"
|
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"
|
||||||
|
@ -48,8 +48,8 @@ install_packages() {
|
|||||||
# Function to disable an extension.
|
# Function to disable an extension.
|
||||||
disable_extension() {
|
disable_extension() {
|
||||||
extension=$1
|
extension=$1
|
||||||
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}"
|
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}"
|
||||||
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file"
|
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "$pecl_file"
|
||||||
sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true
|
sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +92,13 @@ add_pdo_extension() {
|
|||||||
echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1
|
echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1
|
||||||
if [ "$ext" = "mysql" ]; then
|
if [ "$ext" = "mysql" ]; then
|
||||||
enable_extension "mysqlnd" "extension"
|
enable_extension "mysqlnd" "extension"
|
||||||
ext_name="mysqli"
|
ext_name='mysqli'
|
||||||
|
elif [ "$ext" = "dblib" ]; then
|
||||||
|
ext_name="sybase"
|
||||||
|
elif [ "$ext" = "firebird" ]; then
|
||||||
|
install_packages libfbclient2 >/dev/null 2>&1
|
||||||
|
enable_extension "pdo_firebird" "extension"
|
||||||
|
ext_name="interbase"
|
||||||
elif [ "$ext" = "sqlite" ]; then
|
elif [ "$ext" = "sqlite" ]; then
|
||||||
ext="sqlite3"
|
ext="sqlite3"
|
||||||
ext_name="sqlite3"
|
ext_name="sqlite3"
|
||||||
|
Loading…
Reference in New Issue
Block a user