32 parent::__construct(
$type );
43 return str_replace(
' ',
'_', $title );
72 if ( defined(
'MW_PHPUNIT_TEST' ) || defined(
'MW_DEV_ENV' ) ) {
78 $t = Title::newFromText( $pageName );
79 return $t->getPrefixedText();
81 static $mediaWikiPageNameNormalizer =
null;
84 return $mediaWikiPageNameNormalizer->normalizePageName(
113 return parse_url( $this->
getPath( self::PATH_PAGE ), PHP_URL_PATH );
123 return parse_url( $this->
getPath( self::PATH_FILE ), PHP_URL_PATH );
162 if (
$url ===
null ) {
166 if ( $pageName !==
false ) {
167 $pageName = $this->
toDBKey( trim( $pageName ) );
187 $filePath = $this->
getPath( self::PATH_FILE );
188 if ( $filePath ===
null ) {
189 throw new RuntimeException(
"getFileUrl called for {$this->getGlobalId()} while PATH_FILE is unset" );
192 if (
$path !==
false ) {
193 $filePath = str_replace(
'$1',
$path, $filePath );
195 wfDeprecatedMsg( __METHOD__ .
': omitting $path is deprecated',
'1.40' );
203class_alias( MediaWikiSite::class,
'MediaWikiSite' );
wfUrlencode( $s)
We want some things to be included as literal characters in our title URLs for prettiness,...
wfDeprecatedMsg( $msg, $version=false, $component=false, $callerOffset=2)
Log a deprecation warning with arbitrary message text.
Service for normalizing a page name via a MediaWiki action API.