From: Brion Vibber Date: Wed, 2 Jul 2008 18:22:38 +0000 (+0000) Subject: Revert r36755 for the moment; various things use 'new Database' X-Git-Tag: 1.31.0-rc.0~46799 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=7b78f7b7aaab4dd49491fed03715590e3b809375;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/db/Database.php b/includes/db/Database.php index 2d31193b6e..3be45d3af4 100644 --- a/includes/db/Database.php +++ b/includes/db/Database.php @@ -2235,32 +2235,6 @@ 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 * @@ -2284,7 +2258,6 @@ class DatabaseMysql extends Database { return false; } } - /** * Release a lock. * @@ -2301,6 +2274,17 @@ class DatabaseMysql extends 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 *****************************************************************************/ diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index a6dda2573f..7334244d89 100755 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -997,6 +997,16 @@ 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; + } } diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 8d2a6750dc..d03298ea74 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -706,5 +706,15 @@ 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 diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 8f8488b9ae..a0d3d6962e 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1327,4 +1327,13 @@ 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 diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index 8b4466ecaf..5299c68810 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -373,6 +373,16 @@ 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; + } }