MediaWiki  master
SpecialRandomRootPage.php
Go to the documentation of this file.
1 <?php
2 
27 namespace MediaWiki\Specials;
28 
31 
33 
38  public function __construct(
39  IConnectionProvider $dbProvider,
40  NamespaceInfo $nsInfo
41  ) {
42  parent::__construct( $dbProvider, $nsInfo );
43  $this->mName = 'Randomrootpage';
44  $dbr = $dbProvider->getReplicaDatabase();
45  $this->extra[] = 'page_title NOT ' . $dbr->buildLike( $dbr->anyString(), '/', $dbr->anyString() );
46  }
47 
48  // Don't select redirects
49  public function isRedirect() {
50  return false;
51  }
52 }
53 
58 class_alias( SpecialRandomRootPage::class, 'SpecialRandomRootPage' );
Special page to direct the user to a random page.
__construct(IConnectionProvider $dbProvider, NamespaceInfo $nsInfo)
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Provide primary and replica IDatabase connections.
getReplicaDatabase( $domain=false, $group=null)
Get connection to a replica database.