* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @license GPL 2+
*/
+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 as subpages
* created
*/
public function __construct( Title $rootPage ) {
- if ( !MWNamespace::hasSubpages( $rootPage->getNamespace() ) ) {
+ if (
+ !MediaWikiServices::getInstance()->getNamespaceInfo()->
+ hasSubpages( $rootPage->getNamespace() )
+ ) {
throw new MWException( "The root page you specified, $rootPage, is in a " .
"namespace where subpages are not allowed" );
}