X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=7b770900fac027142e7c09559da12d6138f98680;hp=523a0f93a69ed55a1195cf668be4543a239a28c1;hb=251a0b97e5bb8711bac1784e90f9b7d61377e7da;hpb=2e248f0bb20cbdf7738a6d44a843eb546c3bbf23 diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 523a0f93a6..7b770900fa 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2088,6 +2088,16 @@ function wfIsHHVM() { return defined( 'HHVM_VERSION' ); } +/** + * Check if we are running from the commandline + * + * @since 1.31 + * @return bool + */ +function wfIsCLI() { + return PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg'; +} + /** * Tries to get the system directory for temporary files. First * $wgTmpDirectory is checked, and then the TMPDIR, TMP, and TEMP @@ -3031,7 +3041,7 @@ function wfWaitForSlaves( $ifWritesSince = null, $wiki = false, $cluster = false, $timeout = null ) { if ( $timeout === null ) { - $timeout = ( PHP_SAPI === 'cli' ) ? 86400 : 10; + $timeout = wfIsCLI() ? 86400 : 10; } if ( $cluster === '*' ) {