r36936 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r36935‎ | r36936 | r36937 >
Date:18:22, 2 July 2008
Author:brion
Status:old
Tags:
Comment:
Revert r36755 for the moment; various things use 'new Database'
or Database::newFromParams() explicitly at the moment. While that's already bad (breaking PG support etc), I'd rather see those get fixed before we go introducing differences between Database and DatabaseMySql.
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/db/DatabasePostgres.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -706,5 +706,15 @@
707707 function getServer() {
708708 return $this->mServer;
709709 }
 710+
 711+ /**
 712+ * No-op lock functions
 713+ */
 714+ public function lock( $lockName, $method ) {
 715+ return true;
 716+ }
 717+ public function unlock( $lockName, $method ) {
 718+ return true;
 719+ }
710720
711721 } // end DatabaseOracle class
Index: trunk/phase3/includes/db/DatabasePostgres.php
@@ -1327,4 +1327,13 @@
13281328 return implode( ' || ', $stringList );
13291329 }
13301330
 1331+ /* These are not used yet, but we know we don't want the default version */
 1332+
 1333+ public function lock( $lockName, $method ) {
 1334+ return true;
 1335+ }
 1336+ public function unlock( $lockName, $method ) {
 1337+ return true;
 1338+ }
 1339+
13311340 } // end DatabasePostgres class
Index: trunk/phase3/includes/db/Database.php
@@ -2236,32 +2236,6 @@
22372237 }
22382238
22392239 /**
2240 - * Acquire a lock, no-op to be overridden
2241 - * by subclasses as needed.
2242 - */
2243 - public function lock( $lockName, $method ) {
2244 - return true;
2245 - }
2246 - /**
2247 - * Release a lock, no-op to be overridden
2248 - * by subclasses as needed.
2249 - */
2250 - public function unlock( $lockName, $method ) {
2251 - return true;
2252 - }
2253 -}
2254 -
2255 -/**
2256 - * Database abstraction object for mySQL
2257 - * Inherit all methods and properties of Database::Database(),
2258 - * except for locking.
2259 - *
2260 - * @ingroup Database
2261 - * @see Database
2262 - */
2263 -class DatabaseMysql extends Database {
2264 -
2265 - /**
22662240 * Acquire a lock
22672241 *
22682242 * Abstracted from Filestore::lock() so child classes can implement for
@@ -2284,7 +2258,6 @@
22852259 return false;
22862260 }
22872261 }
2288 -
22892262 /**
22902263 * Release a lock.
22912264 *
@@ -2301,6 +2274,17 @@
23022275 }
23032276 }
23042277
 2278+/**
 2279+ * Database abstraction object for mySQL
 2280+ * Inherit all methods and properties of Database::Database()
 2281+ *
 2282+ * @ingroup Database
 2283+ * @see Database
 2284+ */
 2285+class DatabaseMysql extends Database {
 2286+ # Inherit all
 2287+}
 2288+
23052289 /******************************************************************************
23062290 * Utility classes
23072291 *****************************************************************************/
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -997,6 +997,16 @@
998998 $this->query("$sql $matches[1],$matches[2])");
999999 }
10001000 }
 1001+
 1002+ /**
 1003+ * No-op lock functions
 1004+ */
 1005+ public function lock( $lockName, $method ) {
 1006+ return true;
 1007+ }
 1008+ public function unlock( $lockName, $method ) {
 1009+ return true;
 1010+ }
10011011
10021012 }
10031013
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -373,6 +373,16 @@
374374 $this->query("$sql $matches[1],$matches[2])");
375375 }
376376 }
 377+
 378+ /**
 379+ * No-op lock functions
 380+ */
 381+ public function lock( $lockName, $method ) {
 382+ return true;
 383+ }
 384+ public function unlock( $lockName, $method ) {
 385+ return true;
 386+ }
377387
378388 }
379389

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r36755Refactoring (un)lock. All the subclasses are currently returning true, except...demon17:06, 27 June 2008

Status & tagging log