48 parent::__construct(
$type );
61 return str_replace(
' ',
'_', $title );
89 if ( defined(
'MW_PHPUNIT_TEST' ) ) {
95 $t = Title::newFromText( $pageName );
96 return $t->getPrefixedText();
98 static $mediaWikiPageNameNormalizer =
null;
100 if ( $mediaWikiPageNameNormalizer ===
null ) {
104 return $mediaWikiPageNameNormalizer->normalizePageName(
120 return self::PATH_PAGE;
131 return parse_url( $this->
getPath( self::PATH_PAGE ), PHP_URL_PATH );
142 return parse_url( $this->
getPath( self::PATH_FILE ), PHP_URL_PATH );
153 $this->
setPath( self::PATH_PAGE, $path );
164 $this->
setPath( self::PATH_FILE, $path );
184 if ( $url ===
false ) {
188 if ( $pageName !==
false ) {
189 $pageName = $this->
toDBKey( trim( $pageName ) );
190 $url = str_replace(
'$1',
wfUrlencode( $pageName ), $url );
208 $filePath = $this->
getPath( self::PATH_FILE );
210 if ( $filePath !==
false ) {
211 $filePath = str_replace(
'$1', $path, $filePath );
wfUrlencode( $s)
We want some things to be included as literal characters in our title URLs for prettiness,...
Service for normalizing a page name using a MediaWiki api.
setPath( $pathType, $fullUrl)
Sets the path used to construct links with.
getPath( $pathType)
Returns the path of the provided type or false if there is no such path.
getLinkPath()
Returns the path used to construct links with or false if there is no such path.