dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Register a default value for the timecorrection preference
[lhc/web/wiklou.git]
/
includes
/
installer
/
SqliteInstaller.php
diff --git
a/includes/installer/SqliteInstaller.php
b/includes/installer/SqliteInstaller.php
index
f990ddf
..
d59c162
100644
(file)
--- a/
includes/installer/SqliteInstaller.php
+++ b/
includes/installer/SqliteInstaller.php
@@
-35,10
+35,10
@@
class SqliteInstaller extends DatabaseInstaller {
*/
public $db;
*/
public $db;
- protected $globalNames =
array(
+ protected $globalNames =
[
'wgDBname',
'wgSQLiteDataDir',
'wgDBname',
'wgSQLiteDataDir',
-
)
;
+
]
;
public function getName() {
return 'sqlite';
public function getName() {
return 'sqlite';
@@
-71,7
+71,7
@@
class SqliteInstaller extends DatabaseInstaller {
$defaults = parent::getGlobalDefaults();
if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
$path = str_replace(
$defaults = parent::getGlobalDefaults();
if ( isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
$path = str_replace(
-
array( '/', '\\' )
,
+
[ '/', '\\' ]
,
DIRECTORY_SEPARATOR,
dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data'
);
DIRECTORY_SEPARATOR,
dirname( $_SERVER['DOCUMENT_ROOT'] ) . '/data'
);
@@
-84,13
+84,13
@@
class SqliteInstaller extends DatabaseInstaller {
public function getConnectForm() {
return $this->getTextBox(
'wgSQLiteDataDir',
public function getConnectForm() {
return $this->getTextBox(
'wgSQLiteDataDir',
- 'config-sqlite-dir',
array()
,
+ 'config-sqlite-dir',
[]
,
$this->parent->getHelpBox( 'config-sqlite-dir-help' )
) .
$this->getTextBox(
'wgDBname',
'config-db-name',
$this->parent->getHelpBox( 'config-sqlite-dir-help' )
) .
$this->getTextBox(
'wgDBname',
'config-db-name',
-
array()
,
+
[]
,
$this->parent->getHelpBox( 'config-sqlite-name-help' )
);
}
$this->parent->getHelpBox( 'config-sqlite-name-help' )
);
}
@@
-115,7
+115,7
@@
class SqliteInstaller extends DatabaseInstaller {
* @return Status
*/
public function submitConnectForm() {
* @return Status
*/
public function submitConnectForm() {
- $this->setVarsFromRequest(
array( 'wgSQLiteDataDir', 'wgDBname' )
);
+ $this->setVarsFromRequest(
[ 'wgSQLiteDataDir', 'wgDBname' ]
);
# Try realpath() if the directory already exists
$dir = self::realpath( $this->getVar( 'wgSQLiteDataDir' ) );
# Try realpath() if the directory already exists
$dir = self::realpath( $this->getVar( 'wgSQLiteDataDir' ) );
@@
-157,9
+157,9
@@
class SqliteInstaller extends DatabaseInstaller {
# Called early on in the installer, later we just want to sanity check
# if it's still writable
if ( $create ) {
# Called early on in the installer, later we just want to sanity check
# if it's still writable
if ( $create ) {
-
wfS
uppressWarnings();
+
MediaWiki\s
uppressWarnings();
$ok = wfMkdirParents( $dir, 0700, __METHOD__ );
$ok = wfMkdirParents( $dir, 0700, __METHOD__ );
-
wfR
estoreWarnings();
+
MediaWiki\r
estoreWarnings();
if ( !$ok ) {
return Status::newFatal( 'config-sqlite-mkdir-error', $dir );
}
if ( !$ok ) {
return Status::newFatal( 'config-sqlite-mkdir-error', $dir );
}
@@
-188,7
+188,7
@@
class SqliteInstaller extends DatabaseInstaller {
# @todo FIXME: Need more sensible constructor parameters, e.g. single associative array
# Setting globals kind of sucks
$wgSQLiteDataDir = $dir;
# @todo FIXME: Need more sensible constructor parameters, e.g. single associative array
# Setting globals kind of sucks
$wgSQLiteDataDir = $dir;
- $db = DatabaseBase::factory( 'sqlite',
array( 'dbname' => $dbName )
);
+ $db = DatabaseBase::factory( 'sqlite',
[ 'dbname' => $dbName ]
);
$status->value = $db;
} catch ( DBConnectionError $e ) {
$status->fatal( 'config-sqlite-connection-error', $e->getMessage() );
$status->value = $db;
} catch ( DBConnectionError $e ) {
$status->fatal( 'config-sqlite-connection-error', $e->getMessage() );
@@
-246,7
+246,7
@@
class SqliteInstaller extends DatabaseInstaller {
global $wgSQLiteDataDir;
# @todo FIXME: setting globals kind of sucks
$wgSQLiteDataDir = $dir;
global $wgSQLiteDataDir;
# @todo FIXME: setting globals kind of sucks
$wgSQLiteDataDir = $dir;
- $conn = DatabaseBase::factory( 'sqlite',
array( 'dbname' => "wikicache" )
);
+ $conn = DatabaseBase::factory( 'sqlite',
[ 'dbname' => "wikicache" ]
);
# @todo: don't duplicate objectcache definition, though it's very simple
$sql =
<<<EOT
# @todo: don't duplicate objectcache definition, though it's very simple
$sql =
<<<EOT
@@
-319,15
+319,15
@@
EOT;
return "# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";
return "# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";
-\$wgObjectCaches[CACHE_DB] =
array(
+\$wgObjectCaches[CACHE_DB] =
[
'class' => 'SqlBagOStuff',
'loggroup' => 'SQLBagOStuff',
'class' => 'SqlBagOStuff',
'loggroup' => 'SQLBagOStuff',
- 'server' =>
array(
+ 'server' =>
[
'type' => 'sqlite',
'dbname' => 'wikicache',
'tablePrefix' => '',
'flags' => 0
'type' => 'sqlite',
'dbname' => 'wikicache',
'tablePrefix' => '',
'flags' => 0
- )
-
)
;";
+ ]
+
]
;";
}
}
}
}