* If an exact title match can be find, or a very slightly close match,
* return the title. If no match, returns NULL.
*
- * @static
* @param string $term
* @return Title
- * @private
*/
- function getNearMatch( $searchterm ) {
+ public static function getNearMatch( $searchterm ) {
global $wgContLang;
$allSearchTerms = array($searchterm);
# There may have been a funny upload, or it may be on a shared
# file repository such as Wikimedia Commons.
if( $title->getNamespace() == NS_IMAGE ) {
- $image = new Image( $title );
- if( $image->exists() ) {
+ $image = wfFindFile( $title );
+ if( $image ) {
return $title;
}
}
/**
* Make a list of searchable namespaces and their canonical names.
* @return array
- * @access public
*/
- function searchableNamespaces() {
+ public static function searchableNamespaces() {
global $wgContLang;
$arr = array();
foreach( $wgContLang->getNamespaces() as $ns => $name ) {
* @param string $title
* @abstract
*/
- function updateTitle( $id, $title ) {
+ function updateTitle( $id, $title ) {
// no-op
- }
+ }
}
function next() {
return false;
}
+
+ /**
+ * Frees the result set, if applicable.
+ * @ access public
+ */
+ function free() {
+ // ...
+ }
}
function searchtitle() {}
function searchtext() {}
}
-?>
+