Refactoring (un)lock. All the subclasses are currently returning true, except for...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 27 Jun 2008 17:06:34 +0000 (17:06 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 27 Jun 2008 17:06:34 +0000 (17:06 +0000)
includes/db/Database.php
includes/db/DatabaseMssql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php

index b6a8c8b..2ba8c20 100644 (file)
@@ -2235,6 +2235,32 @@ class Database {
                return 'CONCAT(' . implode( ',', $stringList ) . ')';
        }
        
+       /**
+        * Acquire a lock, no-op to be overridden
+        * by subclasses as needed.
+        */
+       public function lock( $lockName, $method ) {
+               return true;
+       }
+       /**
+        * Release a lock, no-op to be overridden
+        * by subclasses as needed.
+        */
+       public function unlock( $lockName, $method ) {
+               return true;
+       }
+}
+
+/**
+ * Database abstraction object for mySQL
+ * Inherit all methods and properties of Database::Database(),
+ * except for locking.
+ *
+ * @ingroup Database
+ * @see Database
+ */
+class DatabaseMysql extends Database {
+       
        /**
         * Acquire a lock
         * 
@@ -2258,6 +2284,7 @@ class Database {
                        return false;
                }
        }
+       
        /**
         * Release a lock.
         * 
@@ -2274,17 +2301,6 @@ class Database {
        }
 }
 
-/**
- * Database abstraction object for mySQL
- * Inherit all methods and properties of Database::Database()
- *
- * @ingroup Database
- * @see Database
- */
-class DatabaseMysql extends Database {
-       # Inherit all
-}
-
 /******************************************************************************
  * Utility classes
  *****************************************************************************/
index 7334244..a6dda25 100755 (executable)
@@ -997,16 +997,6 @@ class DatabaseMssql extends Database {
                        $this->query("$sql $matches[1],$matches[2])");
                }
        }
-       
-       /** 
-        * No-op lock functions
-        */
-       public function lock( $lockName, $method ) {
-               return true;
-       }
-       public function unlock( $lockName, $method ) {
-               return true;
-       }
 
 }
 
index d03298e..8d2a675 100644 (file)
@@ -706,15 +706,5 @@ echo "error!\n";
        function getServer() {
                return $this->mServer;
        }
-       
-       /** 
-        * No-op lock functions
-        */
-       public function lock( $lockName, $method ) {
-               return true;
-       }
-       public function unlock( $lockName, $method ) {
-               return true;
-       }
 
 } // end DatabaseOracle class
index a0d3d69..8f8488b 100644 (file)
@@ -1327,13 +1327,4 @@ END;
                return implode( ' || ', $stringList );
        }
 
-       /* These are not used yet, but we know we don't want the default version */
-
-       public function lock( $lockName, $method ) {
-               return true;
-       }
-       public function unlock( $lockName, $method ) {
-               return true;
-       }
-
 } // end DatabasePostgres class
index 5299c68..8b4466e 100644 (file)
@@ -373,16 +373,6 @@ class DatabaseSqlite extends Database {
                        $this->query("$sql $matches[1],$matches[2])");
                }
        }
-       
-       /** 
-        * No-op lock functions
-        */
-       public function lock( $lockName, $method ) {
-               return true;
-       }
-       public function unlock( $lockName, $method ) {
-               return true;
-       }
 
 }