r75002 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75001‎ | r75002 | r75003 >
Date:06:25, 19 October 2010
Author:freakolowsky
Status:ok
Tags:
Comment:
* fixed r74949 remarks
* modified version lookup, added 9iR1 as minimum version for installation.
Modified paths:
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/OracleInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -238,13 +238,13 @@
239239 // changed internal variables functions
240240 // mServer now holds the TNS endpoint
241241 // mDBname is schema name if different from username
242 - if ($server == null || $server == false) {
 242+ if ( !$server ) {
243243 // backward compatibillity (server used to be null and TNS was supplied in dbname)
244244 $this->mServer = $dbName;
245245 $this->mDBname = $user;
246246 } else {
247247 $this->mServer = $server;
248 - if ( $dbName == null || $dbName == false ) {
 248+ if ( !$dbName ) {
249249 $this->mDBname = $user;
250250 } else {
251251 $this->mDBname = $dbName;
@@ -851,7 +851,12 @@
852852 * @return string Version information from the database
853853 */
854854 function getServerVersion() {
855 - return oci_server_version( $this->mConn );
 855+ //better version number, fallback on driver
 856+ $rset = $this->doQuery( 'SELECT version FROM product_component_version WHERE UPPER(product) LIKE \'ORACLE DATABASE%\'' );
 857+ if ( !( $row = $rset->fetchRow() ) ) {
 858+ return oci_server_version( $this->mConn );
 859+ }
 860+ return $row['version'];
856861 }
857862
858863 /**
@@ -1047,11 +1052,10 @@
10481053
10491054 function selectDB( $db ) {
10501055 if ( $db == null || $db == $this->mUser ) { return true; }
1051 - $sql = 'ALTER SESSION SET CURRENT_SCHEMA='.strtoupper($db);
1052 - $stmt = oci_parse( $this->mConn, 'ALTER SESSION SET CURRENT_SCHEMA='.strtoupper($db) );
 1056+ $sql = 'ALTER SESSION SET CURRENT_SCHEMA=' . strtoupper($db);
 1057+ $stmt = oci_parse( $this->mConn, $sql );
10531058 if ( !oci_execute( $stmt ) ) {
10541059 $e = oci_error( $stmt );
1055 -// wfDebugDieBacktrace(print_r($e, true));
10561060 if ( $e['code'] != '1435' ) {
10571061 $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ );
10581062 }
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -178,7 +178,7 @@
179179
180180 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.',
181181 'config-db-host-oracle' => 'Database TNS:',
182 - #'config-db-host-oracle-help' => 'TODO!:', // Re-enable this message when the help text is ready
 182+ '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.',
183183 'config-db-wiki-settings' => 'Identify this wiki',
184184 'config-db-name' => 'Database name:',
185185 'config-db-name-help' => 'Choose a name that identifies your wiki.
Index: trunk/phase3/includes/installer/OracleInstaller.php
@@ -28,6 +28,8 @@
2929 '_OracleUseSysdba' => true
3030 );
3131
 32+ public $minimumVersion = '9.0.1'; // 9iR1
 33+
3234 public function getName() {
3335 return 'oracle';
3436 }
@@ -100,13 +102,12 @@
101103 }
102104 $conn = $status->value;
103105
104 -/*
105106 // Check version
106107 $version = $conn->getServerVersion();
107108 if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
108 - return Status::newFatal( 'config-mysql-old', $this->minimumVersion, $version );
 109+ return Status::newFatal( 'config-oracle-old', $this->minimumVersion, $version );
109110 }
110 -*/
 111+
111112 return $status;
112113 }
113114

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r74949* Installer: works (beta). More testing tomorow....freakolowsky16:09, 18 October 2010

Status & tagging log