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
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\"." );
}
}