diff options
Diffstat (limited to 'php-pear/php/CONFIGURE')
-rwxr-xr-x | php-pear/php/CONFIGURE | 84 |
1 files changed, 54 insertions, 30 deletions
diff --git a/php-pear/php/CONFIGURE b/php-pear/php/CONFIGURE index cf387bd5a3..1c3a799bf8 100755 --- a/php-pear/php/CONFIGURE +++ b/php-pear/php/CONFIGURE @@ -1,4 +1,5 @@ -. $GRIMOIRE/config_query_multi.function && +. "$GRIMOIRE/FUNCTIONS" && + message "${MESSAGE_COLOR}PEAR support will enable the CLI version and force depends on libxml2" && message "It will also enable some PCRE support (internal recommended)${DEFAULT_COLOR}" && # prior pear enabledness @@ -11,8 +12,11 @@ config_query PHP5_PEAR "Do you want PEAR support?" y && config_query_option PHP5_OPTS "Enable IPv6?" n \ "--enable-ipv6" "--disable-ipv6" && -config_query_option PHP5_OPTS "Enable PHP safe mode?" n \ - "--enable-safe-mode" "--disable-safe-mode" && +if is_version_less "${VERSION}" 5.4; then + config_query_option PHP5_OPTS "Enable PHP safe mode?" n \ + "--enable-safe-mode" \ + "--disable-safe-mode" +fi && 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 && |