X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=a06d72100f2c346a152cb414d8a509d0871145ce;hp=310adeb0be085bf95a27fd2a49e5839622d8711e;hb=faf7cc4a09848c538320bd2b9067b1a77c0a0183;hpb=643ebd78e43d04553a1f581e1b6607c2706dcfce diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 310adeb0be..a06d72100f 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -582,7 +582,7 @@ function wfAppendQuery( $url, $query ) { * like "subdir/foo.html", etc. * * @param string $url Either fully-qualified or a local path + query - * @param string $defaultProto One of the PROTO_* constants. Determines the + * @param string|int|null $defaultProto One of the PROTO_* constants. Determines the * protocol to use if $url or $wgServer is protocol-relative * @return string|false Fully-qualified URL, current-path-relative URL or false if * no valid URL can be constructed @@ -1010,7 +1010,7 @@ function wfMakeUrlIndexes( $url ) { /** * Check whether a given URL has a domain that occurs in a given set of domains - * @param string $url URL + * @param string $url * @param array $domains Array of domains (strings) * @return bool True if the host part of $url ends in one of the strings in $domains */ @@ -2021,7 +2021,7 @@ function wfSuppressWarnings( $end = false ) { * Restore error level to previous value */ function wfRestoreWarnings() { - MediaWiki\suppressWarnings( true ); + MediaWiki\restoreWarnings(); } /** @@ -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 === '*' ) {