/** @var array */
private $mFieldInfoCache = array();
- function __construct( $p = null ) {
+ function __construct( array $p ) {
global $wgDBprefix;
- if ( !is_array( $p ) ) { // legacy calling pattern
- wfDeprecated( __METHOD__ . " method called without parameter array.", "1.22" );
- $args = func_get_args();
- $p = array(
- 'host' => isset( $args[0] ) ? $args[0] : false,
- 'user' => isset( $args[1] ) ? $args[1] : false,
- 'password' => isset( $args[2] ) ? $args[2] : false,
- 'dbname' => isset( $args[3] ) ? $args[3] : false,
- 'flags' => isset( $args[4] ) ? $args[4] : 0,
- 'tablePrefix' => isset( $args[5] ) ? $args[5] : 'get from global',
- 'schema' => 'get from global',
- 'foreign' => isset( $args[6] ) ? $args[6] : false
- );
- }
if ( $p['tablePrefix'] == 'get from global' ) {
$p['tablePrefix'] = $wgDBprefix;
}
function __destruct() {
if ( $this->mOpened ) {
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$this->close();
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
}
}
$session_mode = $this->mFlags & DBO_SYSDBA ? OCI_SYSDBA : OCI_DEFAULT;
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
if ( $this->mFlags & DBO_PERSISTENT ) {
$this->mConn = oci_pconnect(
$this->mUser,
$session_mode
);
}
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( $this->mUser != $this->mDBname ) {
//change current schema in session
$explain_count
);
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
if ( ( $this->mLastResult = $stmt = oci_parse( $this->mConn, $sql ) ) === false ) {
$e = oci_error( $this->mConn );
}
}
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( $explain_count > 0 ) {
return $this->doQuery( 'SELECT id, cardinality "ROWS" FROM plan_table ' .
}
}
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
$e = oci_error( $stmt );
$this->mAffectedRows = oci_num_rows( $stmt );
}
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( isset( $lob ) ) {
foreach ( $lob as $lob_v ) {
}
$sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper( $db );
$stmt = oci_parse( $this->mConn, $sql );
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
$success = oci_execute( $stmt );
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( !$success ) {
$e = oci_error( $stmt );
if ( $e['code'] != '1435' ) {
}
}
- wfSuppressWarnings();
+ MediaWiki\suppressWarnings();
if ( oci_execute( $stmt, $this->execFlags() ) === false ) {
$e = oci_error( $stmt );
$this->mAffectedRows = oci_num_rows( $stmt );
}
- wfRestoreWarnings();
+ MediaWiki\restoreWarnings();
if ( isset( $lob ) ) {
foreach ( $lob as $lob_v ) {