<?php
class SqliteInstaller extends DatabaseInstaller {
+
protected $globalNames = array(
'wgDBname',
'wgSQLiteDataDir',
);
- function getName() {
+ public function getName() {
return 'sqlite';
}
return self::checkExtension( 'pdo_sqlite' );
}
- function getGlobalDefaults() {
+ public function getGlobalDefaults() {
if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
$path = str_replace(
array( '/', '\\' ),
}
}
- function getConnectForm() {
+ public function getConnectForm() {
return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir' ) .
$this->parent->getHelpBox( 'config-sqlite-dir-help' ) .
$this->getTextBox( 'wgDBname', 'config-db-name' ) .
$this->parent->getHelpBox( 'config-sqlite-name-help' );
}
- function submitConnectForm() {
+ public function submitConnectForm() {
global $wgSQLiteDataDir;
$this->setVarsFromRequest( array( 'wgSQLiteDataDir', 'wgDBname' ) );
return Status::newGood();
}
- function getConnection() {
+ public function getConnection() {
global $wgSQLiteDataDir;
$status = Status::newGood();
return $status;
}
- function needsUpgrade() {
+ public function needsUpgrade() {
$dir = $this->getVar( 'wgSQLiteDataDir' );
$dbName = $this->getVar( 'wgDBname' );
// Don't create the data file yet
return parent::needsUpgrade();
}
- function getSettingsForm() {
+ public function getSettingsForm() {
return false;
}
- function submitSettingsForm() {
+ public function submitSettingsForm() {
return Status::newGood();
}
- function setupDatabase() {
+ public function setupDatabase() {
$dir = $this->getVar( 'wgSQLiteDataDir' );
# Sanity check. We checked this before but maybe someone deleted the
return $this->getConnection();
}
- function createTables() {
+ public function createTables() {
global $IP;
$status = $this->getConnection();
if ( !$status->isOK() ) {
return $this->setupSearchIndex();
}
- function setupSearchIndex() {
+ public function setupSearchIndex() {
global $IP;
$status = Status::newGood();
return $status;
}
- function doUpgrade() {
+ public function doUpgrade() {
global $wgDatabase;
LBFactory::enableBackend();
$wgDatabase = wfGetDB( DB_MASTER );
return true;
}
- static function outputHandler( $string ) {
+ public static function outputHandler( $string ) {
return htmlspecialchars( $string );
}
- function getLocalSettings() {
+ public function getLocalSettings() {
$dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
return
"# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";";
}
-}
+
+}
\ No newline at end of file