if ( substr( $url, 0, 2 ) == '//' ) {
$url = $defaultProtoWithoutSlashes . $url;
if ( substr( $url, 0, 2 ) == '//' ) {
$url = $defaultProtoWithoutSlashes . $url;
*
* @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
* XXX: generalize to negotiate other stuff
*
* @todo FIXME: Doesn't handle params like 'text/plain; charset=UTF-8'
* XXX: generalize to negotiate other stuff
*/
function wfPercent( $nr, $acc = 2, $round = true ) {
$ret = sprintf( "%.${acc}f", $nr );
*/
function wfPercent( $nr, $acc = 2, $round = true ) {
$ret = sprintf( "%.${acc}f", $nr );
* including errors from limit.sh
* - profileMethod: By default this function will profile based on the calling
* method. Set this to a string for an alternative method to profile from
* including errors from limit.sh
* - profileMethod: By default this function will profile based on the calling
* method. Set this to a string for an alternative method to profile from
*
* @return string Collected stdout as a string
* @deprecated since 1.30 use class MediaWiki\Shell\Shell
*
* @return string Collected stdout as a string
* @deprecated since 1.30 use class MediaWiki\Shell\Shell
* @param array $options Associative array of options:
* 'php': The path to the php executable
* 'wrapper': Path to a PHP wrapper to handle the maintenance script
* @param array $options Associative array of options:
* 'php': The path to the php executable
* 'wrapper': Path to a PHP wrapper to handle the maintenance script
// Note that CLI scripts use 0
if ( $timeLimit > 0 && $wgTransactionalTimeLimit > $timeLimit ) {
set_time_limit( $wgTransactionalTimeLimit );
// Note that CLI scripts use 0
if ( $timeLimit > 0 && $wgTransactionalTimeLimit > $timeLimit ) {
set_time_limit( $wgTransactionalTimeLimit );
$result = unpack( $format, $data );
Wikimedia\restoreWarnings();
$result = unpack( $format, $data );
Wikimedia\restoreWarnings();
if ( $result === false ) {
// If it cannot extract the packed data.
throw new MWException( "unpack could not unpack binary data" );
if ( $result === false ) {
// If it cannot extract the packed data.
throw new MWException( "unpack could not unpack binary data" );