Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -238,13 +238,13 @@ |
239 | 239 | // changed internal variables functions |
240 | 240 | // mServer now holds the TNS endpoint |
241 | 241 | // mDBname is schema name if different from username |
242 | | - if ($server == null || $server == false) { |
| 242 | + if ( !$server ) { |
243 | 243 | // backward compatibillity (server used to be null and TNS was supplied in dbname) |
244 | 244 | $this->mServer = $dbName; |
245 | 245 | $this->mDBname = $user; |
246 | 246 | } else { |
247 | 247 | $this->mServer = $server; |
248 | | - if ( $dbName == null || $dbName == false ) { |
| 248 | + if ( !$dbName ) { |
249 | 249 | $this->mDBname = $user; |
250 | 250 | } else { |
251 | 251 | $this->mDBname = $dbName; |
— | — | @@ -851,7 +851,12 @@ |
852 | 852 | * @return string Version information from the database |
853 | 853 | */ |
854 | 854 | 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']; |
856 | 861 | } |
857 | 862 | |
858 | 863 | /** |
— | — | @@ -1047,11 +1052,10 @@ |
1048 | 1053 | |
1049 | 1054 | function selectDB( $db ) { |
1050 | 1055 | 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 ); |
1053 | 1058 | if ( !oci_execute( $stmt ) ) { |
1054 | 1059 | $e = oci_error( $stmt ); |
1055 | | -// wfDebugDieBacktrace(print_r($e, true)); |
1056 | 1060 | if ( $e['code'] != '1435' ) { |
1057 | 1061 | $this->reportQueryError( $e['message'], $e['code'], $sql, __METHOD__ ); |
1058 | 1062 | } |
Index: trunk/phase3/includes/installer/Installer.i18n.php |
— | — | @@ -178,7 +178,7 @@ |
179 | 179 | |
180 | 180 | 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.', |
181 | 181 | '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.', |
183 | 183 | 'config-db-wiki-settings' => 'Identify this wiki', |
184 | 184 | 'config-db-name' => 'Database name:', |
185 | 185 | 'config-db-name-help' => 'Choose a name that identifies your wiki. |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -28,6 +28,8 @@ |
29 | 29 | '_OracleUseSysdba' => true |
30 | 30 | ); |
31 | 31 | |
| 32 | + public $minimumVersion = '9.0.1'; // 9iR1 |
| 33 | + |
32 | 34 | public function getName() { |
33 | 35 | return 'oracle'; |
34 | 36 | } |
— | — | @@ -100,13 +102,12 @@ |
101 | 103 | } |
102 | 104 | $conn = $status->value; |
103 | 105 | |
104 | | -/* |
105 | 106 | // Check version |
106 | 107 | $version = $conn->getServerVersion(); |
107 | 108 | 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 ); |
109 | 110 | } |
110 | | -*/ |
| 111 | + |
111 | 112 | return $status; |
112 | 113 | } |
113 | 114 | |