Sqlite: DBError expects a database object as its first parameter
authorChad Horohoe <chadh@wikimedia.org>
Tue, 16 Aug 2016 20:30:04 +0000 (13:30 -0700)
committerChad Horohoe <chadh@wikimedia.org>
Tue, 16 Aug 2016 20:32:09 +0000 (13:32 -0700)
That constructor is dumb. It's also dumb to need a DB object
considering the only subclass using it is DBConnectionError
to getServerName()

Change-Id: I8e09989fd6635ccdffdba1102f55a9d3b7ba2f6e

includes/db/DatabaseSqlite.php

index 9d0a0f7..5bbba88 100644 (file)
@@ -911,7 +911,7 @@ class DatabaseSqlite extends Database {
        public function lock( $lockName, $method, $timeout = 5 ) {
                if ( !is_dir( "{$this->dbDir}/locks" ) ) { // create dir as needed
                        if ( !is_writable( $this->dbDir ) || !mkdir( "{$this->dbDir}/locks" ) ) {
-                               throw new DBError( "Cannot create directory \"{$this->dbDir}/locks\"." );
+                               throw new DBError( $this, "Cannot create directory \"{$this->dbDir}/locks\"." );
                        }
                }