diff options
Diffstat (limited to 'install.php')
-rw-r--r-- | install.php | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/install.php b/install.php index 46248c789..c2ca7e119 100644 --- a/install.php +++ b/install.php @@ -256,6 +256,15 @@ function haveExternalLibrary($external_library) return true; } +// Attempt to include a PHP file and report if it worked, while +// suppressing the annoying warning messages on failure. +function haveIncludeFile($filename) { + $old = error_reporting(error_reporting() & ~E_WARNING); + $ok = include_once($filename); + error_reporting($old); + return $ok; +} + /** * Check if all is ready for installation * @@ -328,12 +337,19 @@ function checkPrereqs() */ function checkExtension($name) { - if (!extension_loaded($name)) { - if (!@dl($name.'.so')) { - return false; - } + if (extension_loaded($name)) { + return true; + } elseif (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode')) { + // dl will throw a fatal error if it's disabled or we're in safe mode. + // More fun, it may not even exist under some SAPIs in 5.3.0 or later... + $soname = $name . '.' . PHP_SHLIB_SUFFIX; + if (PHP_SHLIB_SUFFIX == 'dll') { + $soname = "php_" . $soname; + } + return @dl($soname); + } else { + return false; } - return true; } /** @@ -390,7 +406,7 @@ E_O_T; E_O_T; foreach ($present_libraries as $library) { echo '<li>'; - if ($library['url']) { + if (isset($library['url'])) { echo '<a href=">'.$library['url'].'">'.htmlentities($library['name']).'</a>'; } else { echo htmlentities($library['name']); |