Index: branches/new-installer/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -0,0 +1,96 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +class OracleInstaller extends InstallerDBType { |
| 5 | + |
| 6 | + var $globalNames = array( |
| 7 | + 'wgDBport', |
| 8 | + 'wgDBname', |
| 9 | + 'wgDBuser', |
| 10 | + 'wgDBpassword', |
| 11 | + 'wgDBprefix', |
| 12 | + ); |
| 13 | + |
| 14 | + var $internalDefaults = array( |
| 15 | + '_InstallUser' => 'sys', |
| 16 | + '_InstallPassword' => '', |
| 17 | + ); |
| 18 | + |
| 19 | + function getName() { |
| 20 | + return 'oracle'; |
| 21 | + } |
| 22 | + |
| 23 | + function isCompiled() { |
| 24 | + return $this->checkExtension( 'oci8' ); |
| 25 | + } |
| 26 | + |
| 27 | + function getGlobalNames() { |
| 28 | + return $this->globalNames; |
| 29 | + } |
| 30 | + |
| 31 | + function getInternalDefaults() { |
| 32 | + return $this->internalDefaults; |
| 33 | + } |
| 34 | + |
| 35 | + function getConnectForm() { |
| 36 | + return |
| 37 | + Xml::openElement( 'fieldset' ) . |
| 38 | + Xml::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) . |
| 39 | + $this->getTextBox( 'wgDBname', 'config-db-name' ) . |
| 40 | + $this->parent->getHelpBox( 'config-db-name-help' ) . |
| 41 | + $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) . |
| 42 | + $this->parent->getHelpBox( 'config-db-prefix-help' ) . |
| 43 | + Xml::closeElement( 'fieldset' ) . |
| 44 | + $this->getInstallUserBox(); |
| 45 | + } |
| 46 | + |
| 47 | + function submitConnectForm() { |
| 48 | + // Get variables from the request |
| 49 | + $newValues = $this->setVarsFromRequest( array( 'wgDBname', 'wgDBprefix' ) ); |
| 50 | + |
| 51 | + // Validate them |
| 52 | + $status = Status::newGood(); |
| 53 | + if ( !strlen( $newValues['wgDBname'] ) ) { |
| 54 | + $status->fatal( 'config-missing-db-name' ); |
| 55 | + } elseif ( !preg_match( '/^[a-zA-Z0-9_]+$/', $newValues['wgDBname'] ) ) { |
| 56 | + $status->fatal( 'config-invalid-db-name', $newValues['wgDBname'] ); |
| 57 | + } |
| 58 | + if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBprefix'] ) ) { |
| 59 | + $status->fatal( 'config-invalid-schema', $newValues['wgDBprefix'] ); |
| 60 | + } |
| 61 | + |
| 62 | + // Submit user box |
| 63 | + if ( $status->isOK() ) { |
| 64 | + $status->merge( $this->submitInstallUserBox() ); |
| 65 | + } |
| 66 | + if ( !$status->isOK() ) { |
| 67 | + return $status; |
| 68 | + } |
| 69 | + |
| 70 | + // Try to connect |
| 71 | + if ( $status->isOK() ) { |
| 72 | + $status->merge( $this->attemptConnection() ); |
| 73 | + } |
| 74 | + if ( !$status->isOK() ) { |
| 75 | + return $status; |
| 76 | + } |
| 77 | + |
| 78 | + // Check version |
| 79 | +/* |
| 80 | + $version = $this->conn->getServerVersion(); |
| 81 | + if ( version_compare( $version, $this->minimumVersion ) < 0 ) { |
| 82 | + return Status::newFatal( 'config-postgres-old', $this->minimumVersion, $version ); |
| 83 | + } |
| 84 | +*/ |
| 85 | + return $status; |
| 86 | + } |
| 87 | + |
| 88 | + |
| 89 | + function getSettingsForm() {} |
| 90 | + |
| 91 | + function submitSettingsForm() {} |
| 92 | + |
| 93 | + function getConnection() {} |
| 94 | + |
| 95 | + function setupDatabase() {} |
| 96 | + |
| 97 | +} |
Property changes on: branches/new-installer/phase3/includes/installer/OracleInstaller.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 98 | + native |