From: Tim Starling Date: Mon, 24 May 2004 03:59:38 +0000 (+0000) Subject: Bug fixes X-Git-Tag: 1.5.0alpha1~3213 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=a0368b8091ec9a41a897802f23c16e533e04ef6a;p=lhc%2Fweb%2Fwiklou.git Bug fixes --- diff --git a/includes/SiteConfiguration.php b/includes/SiteConfiguration.php index d717129afa..aa0a6b56aa 100644 --- a/includes/SiteConfiguration.php +++ b/includes/SiteConfiguration.php @@ -9,20 +9,21 @@ class SiteConfiguration { var $localDatabases; function get( $setting, $wiki, $suffix, $params = array() ) { - if ( array_key_exists( $this->settings[$setting], $wiki ) ) { + if ( array_key_exists( $wiki, $this->settings[$setting] ) ) { $retval = $this->settings[$setting][$wiki]; - } elseif ( array_key_exists( $this->settings[$setting], $suffix ) ) { + } elseif ( array_key_exists( $suffix, $this->settings[$setting] ) ) { $retval = $this->settings[$setting][$suffix]; - } elseif ( array_key_exists( $this->settings[$setting], "default" ) ) { + } elseif ( array_key_exists( "default", $this->settings[$setting] ) ) { $retval = $this->settings[$setting]['default']; } else { $retval = NULL; } if ( !is_null( $retval ) && count( $params ) ) { foreach ( $params as $key => $value ) { - str_replace( "\${$key}", $value, $retval ); + $retval = str_replace( '$' . $key, $value, $retval ); } } + return $retval; } function getBool( $setting, $wiki, $suffix ) { @@ -39,22 +40,22 @@ class SiteConfiguration { } } - function extractVar( $setting, $wiki, $suffix, &$var, &$params ) { - $value = $this->get( $settings, $wiki, $suffix, $params ); + function extractVar( $setting, $wiki, $suffix, &$var, $params ) { + $value = $this->get( $setting, $wiki, $suffix, $params ); if ( !is_null( $value ) ) { $var = $value; } } - function extractGlobal( $setting, $wiki, $suffix, &$params ) { - $value = $this->get( $settings, $wiki, $suffix, $params ); + function extractGlobal( $setting, $wiki, $suffix, $params ) { + $value = $this->get( $setting, $wiki, $suffix, $params ); if ( !is_null( $value ) ) { $GLOBALS[$setting] = $value; } } - function extractAllGlobals( $wiki, $suffix, &$params ) { - foreach ( $settings as $varName => $setting ) { + function extractAllGlobals( $wiki, $suffix, $params ) { + foreach ( $this->settings as $varName => $setting ) { $this->extractGlobal( $varName, $wiki, $suffix, $params ); } } diff --git a/maintenance/convertLinks.inc b/maintenance/convertLinks.inc index 4ca7cd4e61..7e24f7c178 100644 --- a/maintenance/convertLinks.inc +++ b/maintenance/convertLinks.inc @@ -4,6 +4,7 @@ function convertLinks() { print "Converting links table to ID-ID...\n"; global $wgLang, $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname; + global $noKeys, $logPerformance, $fh; $numRows = $tuplesAdded = $numBadLinks = $curRowsRead = 0; #counters etc $totalTuplesInserted = 0; # total tuples INSERTed into links_temp @@ -39,12 +40,11 @@ function convertLinks() { print "No rows to convert. Updating schema...\n"; createTempTable(); } else { - $row = wfFetchObject( $res ); - if ( is_numeric( $row->l_from ) ) { + $res = wfQuery( "SELECT l_from FROM links LIMIT 1", DB_READ ); + if ( mysql_field_type( $res, 0 ) == "int" ) { print "Schema already converted\n"; exit; - } - + } if ( $logPerformance ) { $fh = fopen ( $perfLogFilename, "w" ); } $baseTime = $startTime = getMicroTime(); # Create a title -> cur_id map