protected $mPHPError = false;
protected $mServer, $mUser, $mPassword, $mConn = null, $mDBname;
- protected $mOut, $mOpened = false;
+ protected $mOpened = false;
protected $mTablePrefix;
protected $mFlags;
* @param $flags Integer: database behaviour flags (optional, unused)
* @param $schema String
*/
- public function DatabaseIbm_db2( $server = false, $user = false,
+ public function __construct( $server = false, $user = false,
$password = false,
$dbName = false, $flags = 0,
$schema = self::USE_GLOBAL )
{
-
- global $wgOut, $wgDBmwschema;
- # Can't get a reference if it hasn't been set yet
- if ( !isset( $wgOut ) ) {
- $wgOut = null;
- }
- $this->mOut =& $wgOut;
- $this->mFlags = DBO_TRX | $flags;
+ global $wgDBmwschema;
if ( $schema == self::USE_GLOBAL ) {
$this->mSchema = $wgDBmwschema;
$this->setDB2Option( 'rowcount', 'DB2_ROWCOUNT_PREFETCH_ON',
self::STMT_OPTION );
- $this->open( $server, $user, $password, $dbName );
+ parent::__construct( $server, $user, $password, $dbName, $flags );
}
/**
}
}
- /**
- * Returns a fresh instance of this class
- *
- * @param $server String: hostname of database server
- * @param $user String: username
- * @param $password String
- * @param $dbName String: database name on the server
- * @param $flags Integer: database behaviour flags (optional, unused)
- * @return DatabaseIbm_db2 object
- */
- static function newFromParams( $server, $user, $password, $dbName,
- $flags = 0 )
- {
- return new DatabaseIbm_db2( $server, $user, $password, $dbName,
- $flags );
- }
-
/**
* Retrieves the most current database error
* Forces a database rollback
function makeList( $a, $mode = LIST_COMMA ) {
if ( !is_array( $a ) ) {
throw new DBUnexpectedError( $this,
- 'DatabaseBase::makeList called with incorrect parameters' );
+ 'DatabaseIbm_db2::makeList called with incorrect parameters' );
}
// if this is for a prepared UPDATE statement
* more of IGNORE, LOW_PRIORITY
* @return Boolean
*/
- public function update( $table, $values, $conds, $fname = 'Database::update',
+ public function update( $table, $values, $conds, $fname = 'DatabaseIbm_db2::update',
$options = array() )
{
$table = $this->tableName( $table );
*
* Use $conds == "*" to delete all rows
*/
- public function delete( $table, $conds, $fname = 'Database::delete' ) {
+ public function delete( $table, $conds, $fname = 'DatabaseIbm_db2::delete' ) {
if ( !$conds ) {
throw new DBUnexpectedError( $this,
- 'Database::delete() called with no conditions' );
+ 'DatabaseIbm_db2::delete() called with no conditions' );
}
$table = $this->tableName( $table );
$sql = "DELETE FROM $table";
* @return Bool
*/
public function indexUnique ( $table, $index,
- $fname = 'Database::indexUnique' )
+ $fname = 'DatabaseIbm_db2::indexUnique' )
{
$table = $this->tableName( $table );
$sql = <<<SQL
{
if ( !$conds ) {
throw new DBUnexpectedError( $this,
- 'Database::deleteJoin() called with empty $conds' );
+ 'DatabaseIbm_db2::deleteJoin() called with empty $conds' );
}
$delTable = $this->tableName( $delTable );