MediaWiki master
SpecialRandomRootPage.php
Go to the documentation of this file.
1<?php
9namespace MediaWiki\Specials;
10
15
22
23 public function __construct(
24 IConnectionProvider $dbProvider,
25 NamespaceInfo $nsInfo
26 ) {
27 parent::__construct( $dbProvider, $nsInfo );
28 $this->mName = 'Randomrootpage';
29 $dbr = $dbProvider->getReplicaDatabase();
30 $this->extra[] = $dbr->expr(
31 'page_title',
32 IExpression::NOT_LIKE,
33 new LikeValue( $dbr->anyString(), '/', $dbr->anyString() )
34 );
35 }
36
38 public function isRedirect() {
39 // Don't select redirects
40 return false;
41 }
42}
43
48class_alias( SpecialRandomRootPage::class, 'SpecialRandomRootPage' );
Redirect to a random page that isn't a subpage.
isRedirect()
select redirects instead of normal pages?bool
__construct(IConnectionProvider $dbProvider, NamespaceInfo $nsInfo)
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Content of like value.
Definition LikeValue.php:14
Provide primary and replica IDatabase connections.
getReplicaDatabase(string|false $domain=false, $group=null)
Get connection to a replica database.