// NOTE: ideally, this would just call makeTitle() and then isValid(),
// but presently, that means more overhead on a potential performance hotspot.
// NOTE: ideally, this would just call makeTitle() and then isValid(),
// but presently, that means more overhead on a potential performance hotspot.
- $parser = MediaWikiServices::getInstance()->getTitleParser();
- $parser->parseTitle( $this->mDbkeyform, $this->mNamespace );
+ $services->getTitleParser()->parseTitle( $this->mDbkeyform, $this->mNamespace );
if ( $this->isExternal() ) {
// This probably shouldn't even happen, except for interwiki transclusion.
// If possible, use the canonical name for the foreign namespace.
if ( $this->isExternal() ) {
// This probably shouldn't even happen, except for interwiki transclusion.
// If possible, use the canonical name for the foreign namespace.
- return MediaWikiServices::getInstance()->getContentLanguage()->
- getNsText( MWNamespace::getSubject( $this->mNamespace ) );
+ $services = MediaWikiServices::getInstance();
+ return $services->getContentLanguage()->
+ getNsText( $services->getNamespaceInfo()->getSubject( $this->mNamespace ) );
- return MediaWikiServices::getInstance()->getContentLanguage()->
- getNsText( MWNamespace::getTalk( $this->mNamespace ) );
+ $services = MediaWikiServices::getInstance();
+ return $services->getContentLanguage()->
+ getNsText( $services->getNamespaceInfo()->getTalk( $this->mNamespace ) );
* @since 1.30
*
* @return bool True if this title either is a talk page or can have a talk page associated.
*/
public function canHaveTalkPage() {
* @since 1.30
*
* @return bool True if this title either is a talk page or can have a talk page associated.
*/
public function canHaveTalkPage() {
* @return string Containing capitalized title
*/
public static function capitalize( $text, $ns = NS_MAIN ) {
* @return string Containing capitalized title
*/
public static function capitalize( $text, $ns = NS_MAIN ) {
if ( $namespaceKey === false ) {
// Fallback to localised text
$namespaceKey = $this->getSubjectNsText();
if ( $namespaceKey === false ) {
// Fallback to localised text
$namespaceKey = $this->getSubjectNsText();
// Optional notice for page itself and any parent page
$editnotice_base = $editnotice_ns;
foreach ( explode( '/', $this->mDbkeyform ) as $part ) {
// Optional notice for page itself and any parent page
$editnotice_base = $editnotice_ns;
foreach ( explode( '/', $this->mDbkeyform ) as $part ) {