Skip to content

Commit

Permalink
Fix pdo setup
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 19, 2021
1 parent 36ec020 commit 3f36c05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/scripts/darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ self_hosted_helper() {
remove_extension() {
extension=$1
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
(! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||
add_log "${cross:?}" ":$extension" "Could not remove $extension on PHP ${semver:?}"
Expand Down
15 changes: 11 additions & 4 deletions src/scripts/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ install_packages() {
# Function to disable an extension.
disable_extension() {
extension=$1
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "${ini_file[@]}"
sudo sed -Ei "/=(.*\/)?\"?$extension/d" "$pecl_file"
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "${ini_file[@]}"
sudo sed -Ei "/=(.*\/)?\"?$extension(.so)?$/d" "$pecl_file"
sudo find "$ini_dir"/.. -name "*$extension.ini" -delete >/dev/null 2>&1 || true
}

Expand Down Expand Up @@ -91,8 +91,15 @@ add_pdo_extension() {
disable_extension pdo
echo "extension=pdo.so" | sudo tee "${ini_file[@]/php.ini/conf.d/10-pdo.ini}" >/dev/null 2>&1
if [ "$ext" = "mysql" ]; then
enable_extension "mysqlnd" "extension"
ext_name="mysqli"
for mysql_ext in "$ext_dir"/*mysql*; do
enable_extension "${mysql_ext%.*}" "extension"
done
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
ext="sqlite3"
ext_name="sqlite3"
Expand Down

0 comments on commit 3f36c05

Please sign in to comment.