* @file
*/
+use MediaWiki\MediaWikiServices;
+
/**
* A class to convert page titles on a foreign wiki (ForeignTitle objects) into
* page titles on the local wiki (Title objects), placing all pages in a fixed
* @param int $ns The namespace to use for all pages
*/
public function __construct( $ns ) {
- if ( !MWNamespace::exists( $ns ) ) {
+ if ( !MediaWikiServices::getInstance()->getNamespaceInfo()->exists( $ns ) ) {
throw new MWException( "Namespace $ns doesn't exist on this wiki" );
}
$this->ns = $ns;