48 parent::__construct(
$type );
61 return str_replace(
' ',
'_', $title );
86 if ( defined(
'MW_PHPUNIT_TEST' ) ) {
92 $t = Title::newFromText( $pageName );
93 return $t->getPrefixedText();
95 static $mediaWikiPageNameNormalizer =
null;
97 if ( $mediaWikiPageNameNormalizer ===
null ) {
101 return $mediaWikiPageNameNormalizer->normalizePageName(
117 return self::PATH_PAGE;
128 return parse_url( $this->
getPath( self::PATH_PAGE ), PHP_URL_PATH );
139 return parse_url( $this->
getPath( self::PATH_FILE ), PHP_URL_PATH );
150 $this->
setPath( self::PATH_PAGE, $path );
161 $this->
setPath( self::PATH_FILE, $path );
181 if ( $url ===
false ) {
185 if ( $pageName !==
false ) {
186 $pageName = $this->
toDBKey( trim( $pageName ) );
187 $url = str_replace(
'$1',
wfUrlencode( $pageName ), $url );
205 $filePath = $this->
getPath( self::PATH_FILE );
207 if ( $filePath !==
false ) {
208 $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.