@@ -93,10 +93,22 @@ declare -a EXTENSIONS=(${@:2})
93
93
ENABLED_EXTENSIONS=$( php -m | tr ' [:upper:]' ' [:lower:]' | egrep -v ' ^[\[]' | grep -v ' zend opcache' )
94
94
EXTENSIONS_TO_INSTALL=()
95
95
96
+ add_extension_to_install () {
97
+ local EXTENSION=$1
98
+
99
+ # Prevent duplicates
100
+ for TO_BE_INSTALLED in " ${EXTENSIONS_TO_INSTALL[@]} " ; do
101
+ if [[ " ${TO_BE_INSTALLED} " == " ${EXTENSION} " ]]; then
102
+ return
103
+ fi
104
+ done
105
+
106
+ EXTENSIONS_TO_INSTALL+=(" ${EXTENSION} " )
107
+ }
108
+
96
109
# Loop through known statically compiled/installed extensions, and enable them.
97
110
# NOTE: when developing on MacOS, remove the quotes while implementing your changes and re-add the quotes afterwards.
98
111
for EXTENSION in " ${EXTENSIONS[@]} " ; do
99
-
100
112
# Check if extension is already enabled
101
113
REGULAR_EXPRESSION=\\ b${EXTENSION} \\ b
102
114
if [[ " ${ENABLED_EXTENSIONS} " =~ $REGULAR_EXPRESSION ]]; then
@@ -112,7 +124,32 @@ for EXTENSION in "${EXTENSIONS[@]}"; do
112
124
continue ;
113
125
fi
114
126
115
- EXTENSIONS_TO_INSTALL+=(" $EXTENSION " )
127
+ if [[ " ${EXTENSION} " =~ ^pdo_ ]]; then
128
+ case " ${EXTENSION} " in
129
+ " pdo_mysql" )
130
+ add_extension_to_install " mysql"
131
+ ;;
132
+ " pdo_sqlite" )
133
+ add_extension_to_install " sqlite3"
134
+ ;;
135
+ " pdo_pgsql" )
136
+ add_extension_to_install " pgsql"
137
+ ;;
138
+ * )
139
+ echo " Unsupported PDO driver extension \" ${EXTENSION} \" cannot is not (yet) supported."
140
+ echo -n " In case the extension is not available already, please consider using .pre-install.sh to install"
141
+ echo " the appropriate extension."
142
+ echo -n " If you think its worth to have the PDO driver extension installed automatically, please create"
143
+ echo " a feature request on github: https://github.com/laminas/laminas-continuous-integration-action/issues"
144
+ continue ;
145
+ ;;
146
+ esac
147
+
148
+ add_extension_to_install " pdo"
149
+ continue ;
150
+ fi
151
+
152
+ add_extension_to_install " ${EXTENSION} "
116
153
done
117
154
118
155
# If by now the extensions list is not empty, install missing extensions.
0 commit comments