Allow passing parameters to preload
[lhc/web/wiklou.git] / mw-config / overrides.php
1 <?php
2 /**
3 * MediaWiki installer overrides.
4 * Modify this file if you are a packager who needs to modify the behavior of the MediaWiki installer.
5 * Altering it is preferred over changing anything in /includes.
6 *
7 * Note: this file doesn't gets included from a global scope, don't use globals directly.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
23 *
24 * @file
25 */
26
27 /*
28
29 Example of modifications:
30
31 public static function getLocalSettingsGenerator( Installer $installer ) {
32 return new MyLocalSettingsGenerator( $installer );
33 }
34
35 Then add the following to the bottom of this file:
36
37 class MyLocalSettingsGenerator extends LocalSettingsGenerator {
38 function getText() {
39 // Modify an existing setting
40 $this->values['wgResourceLoaderMaxQueryLength'] = 512;
41 // add a new setting
42 $ls = parent::getText();
43 return $ls . "\n\$wgUseTex = true;\n";
44 }
45 }
46 */
47
48 /**
49 * @since 1.20
50 */
51 class InstallerOverrides {
52 /**
53 * Instantiates and returns an instance of LocalSettingsGenerator or its descendant classes
54 * @param Installer $installer
55 * @return LocalSettingsGenerator
56 */
57 public static function getLocalSettingsGenerator( Installer $installer ) {
58 return new LocalSettingsGenerator( $installer );
59 }
60
61 /**
62 * Instantiates and returns an instance of WebInstaller or its descendant classes
63 * @param WebRequest $request
64 * @return WebInstaller
65 */
66 public static function getWebInstaller( WebRequest $request ) {
67 return new WebInstaller( $request );
68 }
69
70 /**
71 * Instantiates and returns an instance of CliInstaller or its descendant classes
72 * @param string $siteName
73 * @param string|null $admin
74 * @param array $options
75 * @return CliInstaller
76 */
77 public static function getCliInstaller( $siteName, $admin = null, array $options = array() ) {
78 return new CliInstaller( $siteName, $admin, $options );
79 }
80 }