r25053 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25052‎ | r25053 | r25054 >
Date:15:05, 22 August 2007
Author:robchurch
Status:old
Tags:
Comment:
(bug 11013) Make sure dl() is available before attempting to use it to check available databases in installer...this detection code is quite crap and could do with some work; got a partial patch, but a few bits (the UI, JavaScript) are broken...committing this to fix the *immediate* problem
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/config/index.php (modified) (history)
  • /trunk/phase3/install-utils.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/config/index.php
@@ -295,7 +295,7 @@
296296 $phpdatabases = array();
297297 foreach (array_keys($ourdb) as $db) {
298298 $compname = $ourdb[$db]['compile'];
299 - if (extension_loaded($compname) or dl($compname . '.' . PHP_SHLIB_SUFFIX)) {
 299+ if( extension_loaded( $compname ) || ( mw_have_dl() && dl( "{$compname}." . PHP_SHLIB_SUFFIX ) ) ) {
300300 array_push($phpdatabases, $db);
301301 $ourdb[$db]['havedriver'] = 1;
302302 }
Index: trunk/phase3/RELEASE-NOTES
@@ -407,6 +407,8 @@
408408 * (bug 9026) Incorrect heading numbering when viewing Special:Statistics with
409409 "auto-numbered headings" enabled
410410 * Fixed invalid XHTML in Special:Upload
 411+* (bug 11013) Make sure dl() is available before attempting to use it to check
 412+ available databases in installer
411413
412414 == API changes since 1.10 ==
413415
Index: trunk/phase3/install-utils.inc
@@ -124,4 +124,17 @@
125125 return $path;
126126 }
127127
128 -?>
 128+/**
 129+ * Is dl() available to us?
 130+ *
 131+ * According to http://uk.php.net/manual/en/function.dl.php, dl()
 132+ * is *not* available when `enable_dl` is off, or under `safe_mode`
 133+ *
 134+ * @return bool
 135+ */
 136+function mw_have_dl() {
 137+ return function_exists( 'dl' )
 138+ && is_callable( 'dl' )
 139+ && ini_get( 'enable_dl' )
 140+ && !ini_get( 'safe_mode' );
 141+}
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r25109Merged revisions 25016-25108 via svnmerge from...david07:30, 24 August 2007

Status & tagging log