Fixed mysqlisms in Database.php comments, abstracted getSearchEngine()
authorMax Semenik <maxsem@users.mediawiki.org>
Sat, 10 Jul 2010 10:15:59 +0000 (10:15 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sat, 10 Jul 2010 10:15:59 +0000 (10:15 +0000)
includes/db/Database.php
includes/db/DatabaseMysql.php

index 79cd8ba..e4f278e 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @file
  * @ingroup Database
- * This file deals with MySQL interface functions
+ * This file deals with database interface functions
  * and query specifics/optimisations
  */
 
@@ -2324,7 +2324,6 @@ abstract class DatabaseBase {
         * @param $lockName String: Name of lock to release
         * @param $method String: Name of method calling us
         *
-        * FROM MYSQL DOCS: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock
         * @return Returns 1 if the lock was released, 0 if the lock was not established
         * by this thread (in which case the lock is not released), and NULL if the named
         * lock did not exist
@@ -2355,14 +2354,12 @@ abstract class DatabaseBase {
        }
 
        /**
-        * Get search engine class. All subclasses of this
-        * need to implement this if they wish to use searching.
+        * Get search engine class. Subclasses that don't support a search engine
+        * should return 'SearchEngineDummy'.
         *
         * @return String
         */
-       public function getSearchEngine() {
-               return "SearchMySQL";
-       }
+       public abstract function getSearchEngine();
 
        /**
         * Allow or deny "big selects" for this session only. This is done by setting
index dcdfa2d..7e93734 100644 (file)
@@ -383,6 +383,9 @@ class DatabaseMysql extends DatabaseBase {
                }
        }
 
+       /**
+        * FROM MYSQL DOCS: http://dev.mysql.com/doc/refman/5.0/en/miscellaneous-functions.html#function_release-lock
+        */
        public function unlock( $lockName, $method ) {
                $lockName = $this->addQuotes( $lockName );
                $result = $this->query( "SELECT RELEASE_LOCK($lockName) as lockstatus", $method );
@@ -410,6 +413,16 @@ class DatabaseMysql extends DatabaseBase {
                $this->query( "UNLOCK TABLES", $method );
        }
 
+       /**
+        * Get search engine class. All subclasses of this
+        * need to implement this if they wish to use searching.
+        *
+        * @return String
+        */
+       public function getSearchEngine() {
+               return 'SearchMySQL';
+       }
+
        public function setBigSelects( $value = true ) {
                if ( $value === 'default' ) {
                        if ( $this->mDefaultBigSelects === null ) {