// changed internal variables functions
// mServer now holds the TNS endpoint
// mDBname is schema name if different from username
- if ($server == null || $server == false) {
+ if ( !$server ) {
// backward compatibillity (server used to be null and TNS was supplied in dbname)
$this->mServer = $dbName;
$this->mDBname = $user;
} else {
$this->mServer = $server;
- if ( $dbName == null || $dbName == false ) {
+ if ( !$dbName ) {
$this->mDBname = $user;
} else {
$this->mDBname = $dbName;
* @return string Version information from the database
*/
function getServerVersion() {
- return oci_server_version( $this->mConn );
+ //better version number, fallback on driver
+ $rset = $this->doQuery( 'SELECT version FROM product_component_version WHERE UPPER(product) LIKE \'ORACLE DATABASE%\'' );
+ if ( !( $row = $rset->fetchRow() ) ) {
+ return oci_server_version( $this->mConn );
+ }
+ return $row['version'];
}
/**
function selectDB( $db ) {
if ( $db == null || $db == $this->mUser ) { return true; }
- $sql = 'ALTER SESSION SET CURRENT_SCHEMA='.strtoupper($db);
- $stmt = oci_parse( $this->mConn, 'ALTER SESSION SET CURRENT_SCHEMA='.strtoupper($db) );
+ $sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper($db);
+ $stmt = oci_parse( $this->mConn, $sql );
if ( !oci_execute( $stmt ) ) {
$e = oci_error( $stmt );
-// wfDebugDieBacktrace(print_r($e, true));
if ( $e['code'] != '1435' ) {
$this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
}
If you are installing on a Windows server and using MySQL, using "localhost" may not work for the server name. If it does not, try "127.0.0.1" for the local IP address.',
'config-db-host-oracle' => 'Database TNS:',
- #'config-db-host-oracle-help' => 'TODO!:', // Re-enable this message when the help text is ready
+ 'config-db-host-oracle-help' => 'Enter a valid [http://download.oracle.com/docs/cd/B28359_01/network.111/b28317/tnsnames.htm Local Connect Name]; a tnsnames.ora file must be visible to this installation.<br />If you are using client libraries 10g or newer you can also use the [http://download.oracle.com/docs/cd/E11882_01/network.112/e10836/naming.htm Easy Connect] naming method.',
'config-db-wiki-settings' => 'Identify this wiki',
'config-db-name' => 'Database name:',
'config-db-name-help' => 'Choose a name that identifies your wiki.
'_OracleUseSysdba' => true
);
+ public $minimumVersion = '9.0.1'; // 9iR1
+
public function getName() {
return 'oracle';
}
}
$conn = $status->value;
-/*
// Check version
$version = $conn->getServerVersion();
if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
- return Status::newFatal( 'config-mysql-old', $this->minimumVersion, $version );
+ return Status::newFatal( 'config-oracle-old', $this->minimumVersion, $version );
}
-*/
+
return $status;
}