Use short array for generator output

The AutoloadGenerator and LocalSettingsGenerator should generate short
array syntax

Change-Id: I5772640556fd6274db0d522341a98c0acfe5794d
This commit is contained in:
umherirrender 2016-02-17 22:08:07 +01:00
parent 8b38f3887f
commit f800abc858
4 changed files with 11 additions and 11 deletions

View file

@ -3,7 +3,7 @@
// @codingStandardsIgnoreFile
global $wgAutoloadLocalClasses;
$wgAutoloadLocalClasses = array(
$wgAutoloadLocalClasses = [
'APCBagOStuff' => __DIR__ . '/includes/libs/objectcache/APCBagOStuff.php',
'AbstractContent' => __DIR__ . '/includes/content/AbstractContent.php',
'Action' => __DIR__ . '/includes/actions/Action.php',
@ -1457,4 +1457,4 @@ $wgAutoloadLocalClasses = array(
'ZipDirectoryReader' => __DIR__ . '/includes/utils/ZipDirectoryReader.php',
'ZipDirectoryReaderError' => __DIR__ . '/includes/utils/ZipDirectoryReader.php',
'profile_point' => __DIR__ . '/profileinfo.php',
);
];

View file

@ -214,9 +214,9 @@ class LocalSettingsGenerator {
$servers = $this->values['_MemCachedServers'];
if ( !$servers ) {
return 'array()';
return '[]';
} else {
$ret = 'array( ';
$ret = '[ ';
$servers = explode( ',', $servers );
foreach ( $servers as $srv ) {
@ -224,7 +224,7 @@ class LocalSettingsGenerator {
$ret .= "'$srv', ";
}
return rtrim( $ret, ', ' ) . ' )';
return rtrim( $ret, ', ' ) . ' ]';
}
}

View file

@ -319,15 +319,15 @@ EOT;
return "# SQLite-specific settings
\$wgSQLiteDataDir = \"{$dir}\";
\$wgObjectCaches[CACHE_DB] = array(
\$wgObjectCaches[CACHE_DB] = [
'class' => 'SqlBagOStuff',
'loggroup' => 'SQLBagOStuff',
'server' => array(
'server' => [
'type' => 'sqlite',
'dbname' => 'wikicache',
'tablePrefix' => '',
'flags' => 0
)
);";
]
];";
}
}

View file

@ -206,9 +206,9 @@ class AutoloadGenerator {
// @codingStandardsIgnoreFile
global \${$this->variableName};
\${$this->variableName} {$op} array(
\${$this->variableName} {$op} [
{$output}
);
];
EOD
);