Add unixodbc if missing in sqlsrv setup

This commit is contained in:
Shivam Mathur 2022-05-25 10:16:23 +05:30
parent 16de39288a
commit fe9e23a16a
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -7,9 +7,18 @@ get_sqlsrv_version() {
fi
}
add_unixodbc() {
if [ "$(uname -s)" = 'Linux' ]; then
install_packages unixodbc-dev
else
brew install unixodbc
fi
}
# Function to install sqlsrv and pdo_sqlsrv.
add_sqlsrv() {
ext=$1
ext_version=$(get_sqlsrv_version)
add_unixodbc >/dev/null 2>&1
add_pecl_extension "$ext" "$ext_version" extension
}