From e257d0313fc4b658332b26da17a32f7080252f7c Mon Sep 17 00:00:00 2001 From: Kevin Israel Date: Tue, 14 Jun 2016 20:14:20 -0400 Subject: [PATCH] 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 --- maintenance/Maintenance.php | 6 ++---- maintenance/install.php | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) 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 ); -- 2.20.1