3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 * http://www.gnu.org/copyleft/gpl.html
19 * @ingroup Maintenance
20 * @defgroup Maintenance Maintenance
23 if ( !defined( 'MW_ENTRY_POINT' ) ) {
24 define( 'MW_ENTRY_POINT', 'cli' );
27 // Bail on old versions of PHP, or if composer has not been run yet to install
29 require_once __DIR__
. '/../includes/PHPVersionCheck.php';
30 wfEntryPointCheck( 'text' );
33 * @defgroup MaintenanceArchive Maintenance archives
34 * @ingroup Maintenance
37 // Define this so scripts can easily find doMaintenance.php
38 define( 'RUN_MAINTENANCE_IF_MAIN', __DIR__
. '/doMaintenance.php' );
40 // Original name for compat, harmless
41 // Support: MediaWiki < 1.31
42 define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN
);
46 * @phan-var class-string|false
50 // Some extensions rely on MW_INSTALL_PATH to find core files to include. Setting it here helps them
51 // if they're included by a core script (like DatabaseUpdater) after Maintenance.php has already
53 if ( strval( getenv( 'MW_INSTALL_PATH' ) ) === '' ) {
54 putenv( 'MW_INSTALL_PATH=' . realpath( __DIR__
. '/..' ) );
57 require_once __DIR__
. '/includes/Maintenance.php';
58 require_once __DIR__
. '/includes/LoggedUpdateMaintenance.php';
59 require_once __DIR__
. '/includes/FakeMaintenance.php';