/**
*
- * @return Status:
+ * @return Status
*/
public function checkPrerequisites() {
$result = Status::newGood();
}
public function getGlobalDefaults() {
+ $defaults = parent::getGlobalDefaults();
if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
$path = str_replace(
array( '/', '\\' ),
dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data'
);
- return array( 'wgSQLiteDataDir' => $path );
- } else {
- return array();
+ $defaults['wgSQLiteDataDir'] = $path;
}
+ return $defaults;
}
public function getConnectForm() {
- return $this->getTextBox( 'wgSQLiteDataDir', 'config-sqlite-dir', array(), $this->parent->getHelpBox( 'config-sqlite-dir-help' ) ) .
- $this->getTextBox( 'wgDBname', 'config-db-name', array(), $this->parent->getHelpBox( 'config-sqlite-name-help' ) );
+ return $this->getTextBox(
+ 'wgSQLiteDataDir',
+ 'config-sqlite-dir', array(),
+ $this->parent->getHelpBox( 'config-sqlite-dir-help' )
+ ) .
+ $this->getTextBox(
+ 'wgDBname',
+ 'config-db-name',
+ array(),
+ $this->parent->getHelpBox( 'config-sqlite-name-help' )
+ );
}
/**
* Safe wrapper for PHP's realpath() that fails gracefully if it's unable to canonicalize the path.
*
- * @param $path string
+ * @param string $path
*
* @return string
*/
}
/**
- * @param $dir
- * @param $create bool
+ * @param string $dir
+ * @param bool $create
* @return Status
*/
private static function dataDirOKmaybeCreate( $dir, $create = false ) {
if ( !is_writable( dirname( $dir ) ) ) {
$webserverGroup = Installer::maybeGetWebserverPrimaryGroup();
if ( $webserverGroup !== null ) {
- return Status::newFatal( 'config-sqlite-parent-unwritable-group', $dir, dirname( $dir ), basename( $dir ), $webserverGroup );
+ return Status::newFatal(
+ 'config-sqlite-parent-unwritable-group',
+ $dir, dirname( $dir ), basename( $dir ),
+ $webserverGroup
+ );
} else {
- return Status::newFatal( 'config-sqlite-parent-unwritable-nogroup', $dir, dirname( $dir ), basename( $dir ) );
+ return Status::newFatal(
+ 'config-sqlite-parent-unwritable-nogroup',
+ $dir, dirname( $dir ), basename( $dir )
+ );
}
}
# @todo FIXME: Need more sensible constructor parameters, e.g. single associative array
# Setting globals kind of sucks
$wgSQLiteDataDir = $dir;
- $db = new DatabaseSqlite( false, false, false, $dbName );
+ $db = DatabaseBase::factory( 'sqlite', array( 'dbname' => $dbName ) );
$status->value = $db;
} catch ( DBConnectionError $e ) {
$status->fatal( 'config-sqlite-connection-error', $e->getMessage() );
}
/**
- * @param $status Status
+ * @param Status $status
* @return Status
*/
public function setupSearchIndex( &$status ) {