From e7d1712d66a6b3770a4f595cf3c01027a9283810 Mon Sep 17 00:00:00 2001 From: withoutaname Date: Tue, 22 Jul 2014 14:07:03 -0700 Subject: [PATCH] Shorten if/else to ternary expressions in WebStart.php Change-Id: Ia12af16e1a6346fac169d5c2a2eee330050bd149 --- includes/WebStart.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/includes/WebStart.php b/includes/WebStart.php index 71454f0456..e137628c5e 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -41,11 +41,7 @@ header( 'X-Content-Type-Options: nosniff' ); $wgRequestTime = microtime( true ); # getrusage() does not exist on the Microsoft Windows platforms, catching this -if ( function_exists ( 'getrusage' ) ) { - $wgRUstart = getrusage(); -} else { - $wgRUstart = array(); -} +$wgRUstart = function_exists( 'getrusage' ) ? getrusage() : array(); unset( $IP ); # Valid web server entry point, enable includes. @@ -61,11 +57,7 @@ define( 'MEDIAWIKI', true ); # if we don't have permissions on parent directories. $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { - if ( realpath( '.' ) ) { - $IP = realpath( '.' ); - } else { - $IP = dirname( __DIR__ ); - } + $IP = realpath( '.' ) ?: dirname( __DIR__ ); } # Start the autoloader, so that extensions can derive classes from core files -- 2.20.1