0abc69f146a8e97d29c1996bdec8702ebb32d9eb
3 * Oracle-specific installer.
10 * Class for setting up the MediaWiki database using Oracle.
15 class OracleInstaller
extends DatabaseInstaller
{
17 protected $globalNames = array(
25 protected $internalDefaults = array(
26 '_InstallUser' => 'sys',
27 '_InstallPassword' => '',
30 public function getName() {
34 public function isCompiled() {
35 return self
::checkExtension( 'oci8' );
38 public function getConnectForm() {
40 Xml
::openElement( 'fieldset' ) .
41 Xml
::element( 'legend', array(), wfMsg( 'config-db-wiki-settings' ) ) .
42 $this->getTextBox( 'wgDBname', 'config-db-name' ) .
43 $this->parent
->getHelpBox( 'config-db-name-help' ) .
44 $this->getTextBox( 'wgDBprefix', 'config-db-prefix' ) .
45 $this->parent
->getHelpBox( 'config-db-prefix-help' ) .
46 Xml
::closeElement( 'fieldset' ) .
47 $this->getInstallUserBox();
50 public function submitConnectForm() {
51 // Get variables from the request
52 $newValues = $this->setVarsFromRequest( array( 'wgDBname', 'wgDBprefix' ) );
55 $status = Status
::newGood();
56 if ( !strlen( $newValues['wgDBname'] ) ) {
57 $status->fatal( 'config-missing-db-name' );
58 } elseif ( !preg_match( '/^[a-zA-Z0-9_]+$/', $newValues['wgDBname'] ) ) {
59 $status->fatal( 'config-invalid-db-name', $newValues['wgDBname'] );
61 if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBprefix'] ) ) {
62 $status->fatal( 'config-invalid-schema', $newValues['wgDBprefix'] );
66 if ( $status->isOK() ) {
67 $status->merge( $this->submitInstallUserBox() );
69 if ( !$status->isOK() ) {
74 if ( $status->isOK() ) {
75 $status->merge( $this->attemptConnection() );
77 if ( !$status->isOK() ) {
83 $version = $this->conn->getServerVersion();
84 if ( version_compare( $version, $this->minimumVersion ) < 0 ) {
85 return Status::newFatal( 'config-postgres-old', $this->minimumVersion, $version );
92 public function getSettingsForm() {
96 public function submitSettingsForm() {
100 public function getConnection() {
104 public function setupDatabase() {
108 public function createTables() {
112 public function getLocalSettings() {
113 $prefix = $this->getVar( 'wgDBprefix' );
115 "# Oracle specific settings
116 \$wgDBprefix = \"{$prefix}\";";