summaryrefslogtreecommitdiff
path: root/includes/db/DatabaseOracle.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-01-18 16:46:04 +0100
commit63601400e476c6cf43d985f3e7b9864681695ed4 (patch)
treef7846203a952e38aaf66989d0a4702779f549962 /includes/db/DatabaseOracle.php
parent8ff01378c9e0207f9169b81966a51def645b6a51 (diff)
Update to MediaWiki 1.20.2
this update includes: * adjusted Arch Linux skin * updated FluxBBAuthPlugin * patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/db/DatabaseOracle.php')
-rw-r--r--includes/db/DatabaseOracle.php48
1 files changed, 29 insertions, 19 deletions
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 855fc831..7d8884fb 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -2,6 +2,21 @@
/**
* This is the Oracle database abstraction layer.
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
* @file
* @ingroup Database
*/
@@ -226,6 +241,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Usually aborts on failure
+ * @return DatabaseBase|null
*/
function open( $server, $user, $password, $dbName ) {
if ( !function_exists( 'oci_connect' ) ) {
@@ -285,17 +301,10 @@ class DatabaseOracle extends DatabaseBase {
/**
* Closes a database connection, if it is open
* Returns success, true if already closed
+ * @return bool
*/
- function close() {
- $this->mOpened = false;
- if ( $this->mConn ) {
- if ( $this->mTrxLevel ) {
- $this->commit();
- }
- return oci_close( $this->mConn );
- } else {
- return true;
- }
+ protected function closeConnection() {
+ return oci_close( $this->mConn );
}
function execFlags() {
@@ -401,6 +410,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* This must be called after nextSequenceVal
+ * @return null
*/
function insertId() {
return $this->mInsertId;
@@ -439,6 +449,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Returns information about an index
* If errors are explicitly ignored, returns NULL on failure
+ * @return bool
*/
function indexInfo( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
return false;
@@ -679,6 +690,7 @@ class DatabaseOracle extends DatabaseBase {
}
/**
* Return the next in a sequence, save the value for retrieval via insertId()
+ * @return null
*/
function nextSequenceValue( $seqName ) {
$res = $this->query( "SELECT $seqName.nextval FROM dual" );
@@ -689,6 +701,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Return sequence_name if table has a sequence
+ * @return bool
*/
private function getSequenceData( $table ) {
if ( $this->sequenceData == null ) {
@@ -797,7 +810,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Return aggregated value function call
*/
- function aggregateValue ( $valuedata, $valuename = 'value' ) {
+ public function aggregateValue( $valuedata, $valuename = 'value' ) {
return $valuedata;
}
@@ -836,6 +849,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Query whether a given index exists
+ * @return bool
*/
function indexExists( $table, $index, $fname = 'DatabaseOracle::indexExists' ) {
$table = $this->tableName( $table );
@@ -855,6 +869,7 @@ class DatabaseOracle extends DatabaseBase {
/**
* Query whether a given table exists (in the given schema, or the default mw one if not given)
+ * @return int
*/
function tableExists( $table, $fname = __METHOD__ ) {
$table = $this->tableName( $table );
@@ -940,12 +955,12 @@ class DatabaseOracle extends DatabaseBase {
return $this->fieldInfoMulti ($table, $field);
}
- function begin( $fname = 'DatabaseOracle::begin' ) {
+ protected function doBegin( $fname = 'DatabaseOracle::begin' ) {
$this->mTrxLevel = 1;
$this->doQuery( 'SET CONSTRAINTS ALL DEFERRED' );
}
- function commit( $fname = 'DatabaseOracle::commit' ) {
+ protected function doCommit( $fname = 'DatabaseOracle::commit' ) {
if ( $this->mTrxLevel ) {
$ret = oci_commit( $this->mConn );
if ( !$ret ) {
@@ -956,7 +971,7 @@ class DatabaseOracle extends DatabaseBase {
}
}
- function rollback( $fname = 'DatabaseOracle::rollback' ) {
+ protected function doRollback( $fname = 'DatabaseOracle::rollback' ) {
if ( $this->mTrxLevel ) {
oci_rollback( $this->mConn );
$this->mTrxLevel = 0;
@@ -964,11 +979,6 @@ class DatabaseOracle extends DatabaseBase {
}
}
- /* Not even sure why this is used in the main codebase... */
- function limitResultForUpdate( $sql, $num ) {
- return $sql;
- }
-
/* defines must comply with ^define\s*([^\s=]*)\s*=\s?'\{\$([^\}]*)\}'; */
function sourceStream( $fp, $lineCallback = false, $resultCallback = false,
$fname = 'DatabaseOracle::sourceStream', $inputCallback = false ) {