* Added new hook GetIP
* (bug 16574) Allow administrators to temporarily disable the account creation
limit for IP addresses: [[MediaWiki:Ratelimit-excluded-ips]]
+* Special:Version now displays whether a SQLite database supports full-text
+ search.
=== Bug fixes in 1.17 ===
* (bug 17560) Half-broken deletion moved image files to deletion archive
/**
* A string describing the current software version, like from
- * mysql_get_server_info(). Will be listed on Special:Version, etc.
+ * mysql_get_server_info().
*
- * @return string: Version information from the database
+ * @return string: Version information from the database server.
*/
public function getServerVersion();
+
+ /**
+ * A string describing the current software version, and possibly
+ * other details in a user-friendly way. Will be listed on Special:Version, etc.
+ * Use getServerVersion() to get machine-friendly information.
+ *
+ * @return string: Version information from the database server
+ */
+ public function getServerInfo();
}
/**
# ------------------------------------------------------------------------------
# These optionally set a variable and return the previous state
+ /**
+ * A string describing the current software version, and possibly
+ * other details in a user-friendly way. Will be listed on Special:Version, etc.
+ * Use getServerVersion() to get machine-friendly information.
+ *
+ * @return string: Version information from the database server
+ */
+ public function getServerInfo() {
+ return $this->getServerVersion();
+ }
+
/**
* Fail function, takes a Database as a parameter
* Set to false for default, 1 for ignore errors
* @return String
*/
function getFulltextSearchModule() {
+ static $cachedResult = null;
+ if ( $cachedResult !== null ) {
+ return $cachedResult;
+ }
+ $cachedResult = false;
$table = 'dummy_search_test';
$this->query( "DROP TABLE IF EXISTS $table", __METHOD__ );
if ( $this->query( "CREATE VIRTUAL TABLE $table USING FTS3(dummy_field)", __METHOD__, true ) ) {
$this->query( "DROP TABLE IF EXISTS $table", __METHOD__ );
- return 'FTS3';
+ $cachedResult = 'FTS3';
}
- return false;
+ return $cachedResult;
}
/**
return $ver;
}
+ /**
+ * @return string User-friendly database information
+ */
+ public function getServerInfo() {
+ return wfMsg( $this->getFulltextSearchModule() ? 'sqlite-has-fts' : 'sqlite-no-fts', $this->getServerVersion() );
+ }
+
/**
* Get information about a given field
* Returns false if the field does not exist.
$software = array();
$software['[http://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked();
$software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")";
- $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion();
+ $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo();
// Allow a hook to add/remove items.
wfRunHooks( 'SoftwareInfo', array( &$software ) );
'htmlform-reset' => 'Undo changes',
'htmlform-selectorother-other' => 'Other',
+# SQLite support
+'sqlite-has-fts' => '$1 with full-text search support',
+'sqlite-no-fts' => '$1 without full-text search support',
+
);
{{Identical|Other}}',
+# SQLite
+'sqlite-has-fts' => 'Shown on Special:Version, $1 is version',
+'sqlite-no-fts' => 'Shown on Special:Version, $1 is version',
);
'htmlform-reset',
'htmlform-selectorother-other',
),
+ 'sqlite' => array(
+ 'sqlite-has-fts',
+ ), 'sqlite-no-fts',
);
/** Comments for each block */
'comparepages' => 'Special:ComparePages',
'db-error-messages' => 'Database error messages',
'html-forms' => 'HTML forms',
+ 'sqlite' => 'SQLite databse support',
);