* 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
if ( $wasRelative ) {
$url = "http:$url";
}
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$bits = parse_url( $url );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
// parse_url() returns an array without scheme for some invalid URLs, e.g.
// parse_url("%0Ahttp://example.com") == [ 'host' => '%0Ahttp', 'path' => 'example.com' ]
if ( !$bits || !isset( $bits['scheme'] ) ) {
/**
* Reference-counted warning suppression
*
- * @deprecated since 1.26, use MediaWiki\suppressWarnings() directly
+ * @deprecated since 1.26, use Wikimedia\suppressWarnings() directly
* @param bool $end
*/
function wfSuppressWarnings( $end = false ) {
- MediaWiki\suppressWarnings( $end );
+ Wikimedia\suppressWarnings( $end );
}
/**
- * @deprecated since 1.26, use MediaWiki\restoreWarnings() directly
+ * @deprecated since 1.26, use Wikimedia\restoreWarnings() directly
* Restore error level to previous value
*/
function wfRestoreWarnings() {
- MediaWiki\suppressWarnings( true );
+ Wikimedia\restoreWarnings();
}
/**
}
// Turn off the normal warning, we're doing our own below
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$ok = mkdir( $dir, $mode, true ); // PHP5 <3
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( !$ok ) {
// directory may have been created on another request since we last checked
# This check may also protect against code injection in
# case of broken installations.
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( !$haveDiff3 ) {
wfDebug( "diff3 not found\n" );
}
global $wgDiff;
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$haveDiff = $wgDiff && file_exists( $wgDiff );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
# This check may also protect against code injection in
# case of broken installations.
return implode( DIRECTORY_SEPARATOR, $pieces );
}
-/**
- * Convert an arbitrarily-long digit string from one numeric base
- * to another, optionally zero-padding to a minimum column width.
- *
- * Supports base 2 through 36; digit values 10-36 are represented
- * as lowercase letters a-z. Input is case-insensitive.
- *
- * @deprecated since 1.27 Use Wikimedia\base_convert() directly
- *
- * @param string $input Input number
- * @param int $sourceBase Base of the input number
- * @param int $destBase Desired base of the output
- * @param int $pad Minimum number of digits in the output (pad with zeroes)
- * @param bool $lowercase Whether to output in lowercase or uppercase
- * @param string $engine Either "gmp", "bcmath", or "php"
- * @return string|bool The output number as a string, or false on error
- */
-function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1,
- $lowercase = true, $engine = 'auto'
-) {
- wfDeprecated( __FUNCTION__, '1.27' );
- return Wikimedia\base_convert( $input, $sourceBase, $destBase, $pad, $lowercase, $engine );
-}
-
/**
* Reset the session id
*
if ( session_id() !== $session->getId() ) {
session_id( $session->getId() );
}
- MediaWiki\quietCall( 'session_start' );
+ Wikimedia\quietCall( 'session_start' );
}
/**
}
try {
- wfGetLBFactory()->waitForReplication( [
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
+ $lbFactory->waitForReplication( [
'wiki' => $wiki,
'cluster' => $cluster,
'timeout' => $timeout,
$conflimit = wfShorthandToInteger( $wgMemoryLimit );
if ( $conflimit == -1 ) {
wfDebug( "Removing PHP's memory limit\n" );
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
ini_set( 'memory_limit', $conflimit );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
return $conflimit;
} elseif ( $conflimit > $memlimit ) {
wfDebug( "Raising PHP's memory limit to $conflimit bytes\n" );
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
ini_set( 'memory_limit', $conflimit );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
return $conflimit;
}
}
}
}
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
$result = unpack( $format, $data );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
if ( $result === false ) {
// If it cannot extract the packed data.
return getrusage( 0 /* RUSAGE_SELF */ );
}
}
-
-/**
- * Begin profiling of a function
- * @param string $functionname Name of the function we will profile
- * @deprecated since 1.25
- */
-function wfProfileIn( $functionname ) {
-}
-
-/**
- * Stop profiling of a function
- * @param string $functionname Name of the function we have profiled
- * @deprecated since 1.25
- */
-function wfProfileOut( $functionname = 'missing' ) {
-}