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