config_query_option PHP5_OPTS "Enable sockets support?" y \
"--enable-sockets" "--disable-sockets" &&
@@ -32,9 +36,9 @@ config_query_list PHP5_SAPI "What SAPI do you want to use?"
\
apache cgi none &&
if [[ $PHP5_SAPI == cgi ]]; then
- PHP5_OPTS="--enable-cgi --without-apxs --without-apxs2 ${PHP5_OPTS}" &&
+ list_add "PHP5_OPTS" "--enable-cgi --without-apxs --without-apxs2" &&
- if [[ $PHP5_BRANCH == legacy ]]; then
+ if is_version_less "${VERSION}" 5.3; then
config_query_option PHP5_OPTS "Enable FastCGI SAPI?" n \
"--enable-fastcgi" "--disable-fastcgi"
else
@@ -47,7 +51,7 @@ fi &&
if [[ "${PHP5_PEAR}" == "y" ]] || list_find "$PHP5_OPTS" "--enable-cgi" ||
list_find "$PHP5_OPTS" "--enable-fastcgi" ; then
message "${MESSAGE_COLOR}Enabling CLI version for PEAR/CGI/FastCGI
support${DEFAULT_COLOR}" &&
- PHP5_OPTS="$PHP5_OPTS --enable-cli"
+ list_add "PHP5_OPTS" "--enable-cli"
else
config_query_option PHP5_OPTS "Enable CLI version?" y \
"--enable-cli" \
@@ -63,51 +67,71 @@ message "${MESSAGE_COLOR}Not recommended: dbm, ndbm.
NOTE: qdbm conflicts with d
config_query_multi PHP5_DBA_DRIVERS "Select dbm-style database drivers (if
any)" none gdbm db4 flatfile inifile qdbm &&
if ! list_find "${PHP5_DBA_DRIVERS}" "none"; then
+ list_add "PHP5_OPTS" "--enable-dba" &&
+
if list_find "${PHP5_DBA_DRIVERS}" "flatfile"; then
- PHP5_OPTS="$PHP5_OPTS --enable-inifile"
- fi
+ list_add "PHP5_OPTS" "--enable-inifile"
+ else
+ list_add "PHP5_OPTS" "--disable-inifile"
+ fi &&
+
if list_find "${PHP5_DBA_DRIVERS}" "flatfile"; then
- PHP5_OPTS="$PHP5_OPTS --enable-flatfile"
+ list_add "PHP5_OPTS" "--enable-flatfile"
+ else
+ list_add "PHP5_OPTS" "--disable-flatfile"
fi
+else
+ list_add "PHP5_OPTS" "--disable-dba"
fi &&
# get the native simple drivers
-local DB_DRIVERS="mysql mysqli pgsql sqlite sqlite3 firebird unixODBC iODBC"
+if is_version_less "${VERSION}" 5.3; then
+ # 5.2 drops SQLite 3 support
+ local DB_DRIVERS="mysql mysqli pgsql sqlite firebird unixODBC iODBC"
+elif is_version_less "${VERSION}" 5.4; then
+ local DB_DRIVERS="mysql mysqli pgsql sqlite sqlite3 firebird unixODBC
iODBC"
+else
+ # 5.4 drops SQLite 2 support
+ local DB_DRIVERS="mysql mysqli pgsql sqlite3 firebird unixODBC iODBC"
+fi &&
+
config_query_multi PHP5_DATABASE_DRIVERS "Select vendor specific database
drivers to install (if any)" \
none all $DB_DRIVERS &&
-if ! list_find "${PHP5_DATABASE_DRIVERS}" "none"; then
- PHP5_OPTS="$PHP5_OPTS --enable-dba" &&
-
- for foo in $DB_DRIVERS; do
- if list_find "${PHP5_DATABASE_DRIVERS}" "$foo" || list_find
"${PHP5_DATABASE_DRIVERS}" "all"; then
- PHP5_OPTS="$PHP5_OPTS --with-$foo"
- else
- PHP5_OPTS="$PHP5_OPTS --without-$foo"
- fi
- done
+# for PDO-only drivers
+if list_find "${PHP5_DATABASE_DRIVERS}" "sqlite3" || list_find
"${PHP5_DATABASE_DRIVERS}" "firebird"; then
+ list_add "PHP5_OPTS" "--enable-pdo"
+else
+ # ask if they want the PDO drivers for the drivers they selected
+ config_query_option PHP5_OPTS "Enable PHP Data Objects?" y \
+ "--enable-pdo" \
+ "--disable-pdo"
fi &&
-# ask if they want the PDO drivers for the drivers they selected
-config_query_option PHP5_OPTS "Enable PHP Data Objects?" y \
- "--enable-pdo" "--disable-pdo" &&
-
if list_find "$PHP5_OPTS" "--enable-pdo"; then
- local PDO_DRIVERS="mysql pgsql sqlite firebird unixODBC iODBC" &&
+ local PDO_DRIVERS="mysql pgsql unixODBC iODBC" &&
for foo in $PDO_DRIVERS; do
if list_find "${PHP5_DATABASE_DRIVERS}" "$foo" || list_find
"${PHP5_DATABASE_DRIVERS}" "all"; then
# odbc special case
if [[ "$foo" == "unixODBC" ]]; then
- config_query_option PHP5_OPTS "Enable PDO driver for unixodbc?" n
"--with-pdo-odbc=unixODBC,${INSTALL_ROOT}/usr" ""
+ config_query_option PHP5_OPTS "Enable PDO driver for unixodbc?" n \
+
"--with-pdo-odbc=unixODBC,${INSTALL_ROOT}/usr" \
+ ""
elif [[ "$foo" == "iODBC" ]]; then
- config_query_option PHP5_OPTS "Enable PDO driver for libiodbc?" n
"--with-pdo-odbc=iODBC,${INSTALL_ROOT}/usr" ""
+ config_query_option PHP5_OPTS "Enable PDO driver for libiodbc?" n \
+
"--with-pdo-odbc=iODBC,${INSTALL_ROOT}/usr" \
+ ""
else
- config_query_option PHP5_OPTS "Enable PDO driver for $foo?" n
"--with-pdo-$foo=${INSTALL_ROOT}/usr" "--without-pdo-$foo"
+ config_query_option PHP5_OPTS "Enable PDO driver for $foo?" n \
+ "--with-pdo-$foo=${INSTALL_ROOT}/usr" \
+ "--without-pdo-$foo"
fi
else
- # be sure that the PDO driver is disabled
- PHP5_OPTS="$PHP5_OPTS --without-pdo-$foo"
+ if [[ "$foo" != "unixODBC" ]] && [[ "$foo" != "iODBC" ]]; then
+ # be sure that the PDO driver is disabled
+ list_add "PHP5_OPTS" "--without-pdo-$foo"
+ fi
fi
done
fi &&
diff --git a/php-pear/php/DEPENDS b/php-pear/php/DEPENDS
index 60c9928..50b6b7d 100755
--- a/php-pear/php/DEPENDS
+++ b/php-pear/php/DEPENDS
@@ -10,7 +10,7 @@ function db_driver_depends() {
if list_find "$PHP5_DATABASE_DRIVERS" "$db_driver" || list_find
"$PHP5_DATABASE_DRIVERS" "all"; then
depends $db_spell "--with-$db_driver"
else
- OPTS="$OPTS --without-$db_driver"
+ list_add "PHP5_OPTS" "--without-$db_driver"
fi
}
@@ -31,7 +31,7 @@ else
"--enable-xml --enable-dom --with-xmlrpc" \
"--disable-xml --disable-dom --without-xmlrpc
--disable-xmlreader --disable-xmlwriter --disable-simplexml" \
"For XML support (required for SOAP)"
-fi
+fi &&
optional_depends libxslt \
"--with-xsl" "--without-xsl" \
@@ -41,7 +41,7 @@ if is_depends_enabled $SPELL libxml2 ; then
config_query_option PHP5_OPTS "Enable SOAP support?" n \
"--enable-soap" "--disable-soap"
else
- PHP5_OPTS="${PHP5_OPTS} --disable-soap"
+ list_add "PHP5_OPTS" "--disable-soap"
fi &&
optional_depends pth \
@@ -55,16 +55,16 @@ if [[ $PHP5_SAPI == apache ]]; then
esac &&
if [[ "$(get_spell_provider $SPELL APACHE)" == 'apache1' ]]; then
- PHP5_OPTS="--with-apxs --without-apxs2 $PHP5_OPTS"
+ list_add "PHP5_OPTS" "--with-apxs --without-apxs2"
else
- PHP5_OPTS="--with-apxs2 --without-apxs $PHP5_OPTS"
+ list_add "PHP5_OPTS" "--with-apxs2 --without-apxs"
fi
fi &&
if [[ "$PHP5_PCRE" == "none" ]]; then
- PHP5_OPTS="$PHP5_OPTS --without-pcre-regex --without-pcre"
+ list_add "PHP5_OPTS" "--without-pcre-regex --without-pcre"
elif [[ "$PHP5_PCRE" == "external" ]]; then
- depends pcre "--with-pcre-regex=${INSTALL_ROOT}/usr
--with-pcre=${INSTALL_ROOT}/usr"
+ depends pcre "--with-pcre-regex=${INSTALL_ROOT}/usr"
fi &&
optional_depends libmcrypt \
"--with-mcrypt" "--without-mcrypt" \
@@ -145,30 +147,49 @@ optional_depends icu \
if list_find "$PHP5_DATABASE_DRIVERS" "mysql" || list_find
"$PHP5_DATABASE_DRIVERS" "all"; then
depends MYSQL &&
- if [[ "${VERSION:0:3}" == "5.3" ]]; then
+ if is_version_less 5.2.9999 "${VERSION}"; then
config_query PHP5_MYSQLND "Do you want to use the MySQL Native Driver
[mysqlnd]? (expiremental)" n &&
if [[ "${PHP5_MYSQLND}" == "y" ]]; then
- PHP5_OPTS="$PHP5_OPTS --with-mysql=mysqlnd"
+ list_add "PHP5_OPTS" "--with-mysql=mysqlnd"
else
- PHP5_OPTS="$PHP5_OPTS --with-mysql"
+ list_add "PHP5_OPTS" "--with-mysql=${INSTALL_ROOT}/usr"
fi
fi
else
- OPTS="$OPTS --without-mysql"
+ list_add "PHP5_OPTS" "--without-mysql"
fi &&
+
db_driver_depends "mysqli" "MYSQL" &&
db_driver_depends "pgsql" "postgresql" &&
-db_driver_depends "sqlite" "sqlite2" &&
-db_driver_depends "sqlite3" "sqlite" &&
-db_driver_depends "firebird" "firebird" &&
+
+if is_version_less "${VERSION}" 5.4; then
+ db_driver_depends "sqlite" "sqlite2"
+fi &&
+
+if is_version_less 5.2.9999 "${VERSION}"; then
+ db_driver_depends "sqlite3" "sqlite"
+fi &&
+
+if list_find "${PHP5_DATABASE_DRIVERS}" "firebird"; then
+ depends firebird "--with-pdo-firebird=${INSTALL_ROOT}/usr"
+else
+ list_add "PHP5_OPTS" "--without-pdo-firebird"
+fi &&
+
+if list_find "${PHP5_DATABASE_DRIVERS}" "sqlite3"; then
+ depends sqlite "--with-pdo-sqlite=${INSTALL_ROOT}/usr"
+else
+ list_add "PHP5_OPTS" "--without-pdo-sqlite"
+fi &&
+
# unixODBC and iODBC are mutually exclusive... first one in wins?
if list_find "$PHP5_DATABASE_DRIVERS" "unixODBC" || list_find
"$PHP5_DATABASE_DRIVERS" "all"; then
depends unixodbc "--with-unixODBC=${INSTALL_ROOT}/usr --without-iodbc"
elif list_find "$PHP5_DATABASE_DRIVERS" "iODBC"; then
depends unixodbc "--with-iodbc=${INSTALL_ROOT}/usr --without-unixODBC"
else
- OPTS="$OPTS --without-iodbc --without-unixODBC"
+ list_add "PHP5_OPTS" "--without-iodbc --without-unixODBC"
fi &&
# DBA drivers
@@ -220,10 +241,9 @@ if [[ "${PHP5_GD}" == "external" ]]; then
fi &&
-if [[ $PHP5_BRANCH != alpha ]] && [[ $PHP5_BRANCH != rc ]]; then
+if [[ $PHP5_BRANCH == legacy ]]; then
message "For more information on Suhosin patchset see: http://www.hardened-php.net/suhosin/" &&
config_query PHP5_SUHOSIN "Do you want the Suhosin patchset enabled?" n
fi
[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (af7c0f8c2aa5c5ccdebe2c4a2a9b4418c6ad7d01),
Vlad Glagolev, 02/26/2013