38 $this->namespaces = MediaWikiServices::getInstance()->getNamespaceInfo()->
39 getContentNamespaces();
40 parent::__construct( $name );
51 $this->namespaces = [ $ns ];
60 if ( is_string( $par ) ) {
64 MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( $par ) );
73 $this->
getNsList(), count( $this->namespaces ) );
78 $redirectParam = $this->
isRedirect() ? [
'redirect' =>
'no' ] : [];
79 $query = array_merge( $this->
getRequest()->getValues(), $redirectParam );
80 unset( $query[
'title'] );
90 $contLang = MediaWikiServices::getInstance()->getContentLanguage();
92 foreach ( $this->namespaces as $n ) {
94 $nsNames[] = $this->
msg(
'blanknamespace' )->plain();
96 $nsNames[] = $contLang->getNsText( $n );
100 return $contLang->commaList( $nsNames );
112 'SpecialRandomGetRandomTitle',
113 [ &$randstr, &$this->isRedir, &$this->namespaces, &$this->extra, &
$title ]
140 $tables = [
'page' ];
141 $conds = array_merge( [
142 'page_namespace' => $this->namespaces,
143 'page_is_redirect' => $redirect,
144 'page_random >= ' . $randstr
149 Hooks::run(
'RandomPageQuery', [ &$tables, &$conds, &$joinConds ] );
153 'fields' => [
'page_title',
'page_namespace' ],
156 'ORDER BY' =>
'page_random',
159 'join_conds' => $joinConds