/**
*
- * @return Status:
+ * @return Status
*/
public function checkPrerequisites() {
$result = Status::newGood();
if ( DatabaseSqlite::getFulltextSearchModule() != 'FTS3' ) {
$result->warning( 'config-no-fts3' );
}
+
return $result;
}
DIRECTORY_SEPARATOR,
dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data'
);
+
return array( 'wgSQLiteDataDir' => $path );
} else {
return array();
}
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
*/
if ( !$result ) {
return $path;
}
+
return $result;
}
}
# Table prefix is not used on SQLite, keep it empty
$this->setVar( 'wgDBprefix', '' );
+
return $result;
}
/**
- * @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 )
+ );
}
}
} catch ( DBConnectionError $e ) {
$status->fatal( 'config-sqlite-connection-error', $e->getMessage() );
}
+
return $status;
}
$this->setVar( 'wgDBuser', '' );
$this->setVar( 'wgDBpassword', '' );
$this->setupSchemaVars();
+
return $this->getConnection();
}
*/
public function createTables() {
$status = parent::createTables();
+
return $this->setupSearchIndex( $status );
}
/**
- * @param $status Status
+ * @param Status $status
* @return Status
*/
public function setupSearchIndex( &$status ) {
} elseif ( !$fts3tTable && $module == 'FTS3' ) {
$this->db->sourceFile( "$IP/maintenance/sqlite/archives/searchindex-fts3.sql" );
}
+
return $status;
}
*/
public function getLocalSettings() {
$dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) );
- return
-"# SQLite-specific settings
+
+ return "# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";";
}
}