summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-09-23 09:45:22 -0400
committerEvan Prodromou <evan@status.net>2009-09-23 09:45:22 -0400
commit8284b3cb82f4dec6e0f2bf74dea6e1a3bc7f4eac (patch)
tree09b8c466df2476f9219550464eb73f6ecaa54e1c /install.php
parent2cabfba767ba0d92d34a6ea4e4cf91c7325f3e95 (diff)
parentbef4a8b6ba9e19f2ec629031444279ca76f17bcf (diff)
Merge branch '0.8.x' into 0.9.x
Conflicts: actions/requesttoken.php classes/File.php install.php lib/noticeform.php
Diffstat (limited to 'install.php')
-rw-r--r--install.php28
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']);