From: Kevin Israel Date: Wed, 15 Jun 2016 00:14:20 +0000 (-0400) Subject: Maintenance: Use __DIR__ instead of dirname( __FILE__ ) X-Git-Tag: 1.31.0-rc.0~6606^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=e257d0313fc4b658332b26da17a32f7080252f7c;p=lhc%2Fweb%2Fwiklou.git Maintenance: Use __DIR__ instead of dirname( __FILE__ ) dirname( __FILE__ ) was used because it worked in PHP 5.2, allowing the version check to function correctly. However, Maintenance.php now uses the short array syntax, which is a parse error before 5.4: > Parse error: syntax error, unexpected '[' in maintenance/Maintenance.php > on line 66 Also, do the same in install.php where it includes Maintenance.php. Change-Id: I3373a02c684bb6cbde83d7bedc204818f3394602 --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index a08297a647..27d816115e 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -21,10 +21,8 @@ */ // Bail on old versions of PHP, or if composer has not been run yet to install -// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+. -// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound -require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php'; -// @codingStandardsIgnoreEnd +// dependencies. +require_once __DIR__ . '/../includes/PHPVersionCheck.php'; wfEntryPointCheck( 'cli' ); /** diff --git a/maintenance/install.php b/maintenance/install.php index ae3074a4c8..3e632f0661 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -21,11 +21,7 @@ * @ingroup Maintenance */ -// Checking for old versions of PHP is done in Maintenance.php -// We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+ -// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound -require_once dirname( __FILE__ ) . '/Maintenance.php'; -// @codingStandardsIgnoreEnd +require_once __DIR__ . '/Maintenance.php'; define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' ); define( 'MEDIAWIKI_INSTALL', true );