Maintenance: Use __DIR__ instead of dirname( __FILE__ )
authorKevin Israel <pleasestand@live.com>
Wed, 15 Jun 2016 00:14:20 +0000 (20:14 -0400)
committerKevin Israel <pleasestand@live.com>
Wed, 15 Jun 2016 00:44:30 +0000 (20:44 -0400)
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
maintenance/install.php

index a08297a..27d8161 100644 (file)
  */
 
 // 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' );
 
 /**
index ae3074a..3e632f0 100644 (file)
  * @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 );