<?php
-
-# MediaWiki web-based config/installation
-# Copyright (C) 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com>
-# http://www.mediawiki.org/
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-# http://www.gnu.org/copyleft/gpl.html
+/**
+ * MediaWiki web-based config/installation
+ *
+ * Copyright © 2004 Brion Vibber <brion@pobox.com>, 2006 Rob Church <robchur@gmail.com>
+ * http://www.mediawiki.org/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
if( !defined( 'MEDIAWIKI_INSTALL' ) ) {
die( 'Not an entry point.' );
'serverless' => true
);
+$ourdb['mssql'] = array(
+ 'fullname' => 'Microsoft SQL Server',
+ 'havedriver' => 0,
+ 'compile' => 'sqlsrv',
+ 'bgcolor' => '#cccccc',
+ 'rootuser' => 'root',
+ 'serverless' => false
+);
+
$ourdb['ibm_db2'] = array(
'fullname' => 'DB2',
'havedriver' => 0,
if( !$ok ) { continue; }
}
+ else if ( $conf->DBtype == 'mssql' ) {
+ # Possible connect as a superuser
+ if ( $useRoot ) {
+ echo( "<li>Attempting to connect to database \"{$conf->DBtype}\" as superuser \"{$conf->RootUser}\"" );
+ $wgDatabase = $dbc->newFromParams(
+ $conf->DBserver,
+ $conf->RootUser,
+ $conf->RootPW,
+ false,
+ false,
+ 1
+ );
+ if ( !$wgDatabase->isOpen() ) {
+ echo( " error: {$wgDatabase->lastError()}</li>\n" );
+ $errs['DBserver'] = 'Could not connect to database as superuser';
+ $errs['RootUser'] = 'Check username';
+ $errs['RootPW'] = 'and password';
+ continue;
+ }
+ $wgDatabase->initial_setup( $conf->DBname, $conf->DBuser, $conf->DBpassword );
+ }
+ echo( "<li>Attempting to connect to database \"{$wgDBname}\" as \"{$wgDBuser}\"..." );
+ $wgDatabase = $dbc->newFromParams(
+ $conf->DBserver,
+ $conf->DBuser,
+ $conf->DBpassword,
+ $conf->DBname,
+ 1
+ );
+ if ( !$wgDatabase->isOpen() ) {
+ echo( " error: {$wgDatabase->lastError()} </li>\n" );
+ } else {
+ $myver = $wgDatabase->getServerVersion();
+ }
+ }
else if( $conf->DBtype == 'ibm_db2' ) {
if( $useRoot ) {
$db_user = $conf->RootUser;
}
} else { # not mysql
error_reporting( E_ALL | E_STRICT );
- $wgSuperUser = '';
## Possible connect as a superuser
// Changed !mysql to postgres check since it seems to only apply to postgres
if( $useRoot && $conf->DBtype == 'postgres' ) {
break;
}
}
- $wgDatabase->freeResult( $res );
if ( !$found && $conf->DBengine != 'MyISAM' ) {
echo "<li><strong>Warning:</strong> " . htmlspecialchars( $conf->DBengine ) .
" storage engine not available, " .
</div>
</fieldset>
+
+ <?php database_switcher( 'mssql' ); ?>
+ <div class="config-desc">
+ <p>No MS SQL Server specific options at this time.</p>
+ </div>
+ </fieldset>
+
+
<?php database_switcher('ibm_db2'); ?>
<div class="config-input"><?php
aField( $conf, "DBport_db2", "Database port:" );
} elseif( $conf->DBtype == 'ibm_db2' ) {
$dbsettings =
"# DB2 specific settings
-\$wgDBport_db2 = \"{$slconf['DBport_db2']}\";
+\$wgDBport = \"{$slconf['DBport_db2']}\";
\$wgDBmwschema = \"{$slconf['DBdb2schema']}\";
\$wgDBcataloged = \"{$slconf['DBcataloged']}\";";
} elseif( $conf->DBtype == 'oracle' ) {