From: Tomas V.V.Cox Date: Wed, 18 Jun 2003 19:27:55 +0000 (+0000) Subject: Be more clever for discovering the default ext_dir X-Git-Tag: RELEASE_1_0_2~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3f9d47aa939167ba34ed1777d218c7ed1398afd;p=php Be more clever for discovering the default ext_dir --- diff --git a/pear/PEAR/Config.php b/pear/PEAR/Config.php index 0358d7c8a2..82c36fad4a 100644 --- a/pear/PEAR/Config.php +++ b/pear/PEAR/Config.php @@ -73,7 +73,15 @@ if (getenv('PHP_PEAR_INSTALL_DIR')) { if (getenv('PHP_PEAR_EXTENSION_DIR')) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR')); } else { - define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir')); + if (!ini_get('extension_dir')) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', ini_get('extension_dir')); + } elseif (defined('PEAR_EXTENSION_DIR') && @is_dir(PEAR_EXTENSION_DIR)) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', PEAR_EXTENSION_DIR); + } elseif (defined('PHP_EXTENSION_DIR')) { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', PHP_EXTENSION_DIR); + } else { + define('PEAR_CONFIG_DEFAULT_EXT_DIR', '.'); + } } // Default for doc_dir