MediaWiki master
SpecialRandomRootPage.php
Go to the documentation of this file.
1<?php
23namespace MediaWiki\Specials;
24
29
36
41 public function __construct(
42 IConnectionProvider $dbProvider,
43 NamespaceInfo $nsInfo
44 ) {
45 parent::__construct( $dbProvider, $nsInfo );
46 $this->mName = 'Randomrootpage';
47 $dbr = $dbProvider->getReplicaDatabase();
48 $this->extra[] = $dbr->expr(
49 'page_title',
50 IExpression::NOT_LIKE,
51 new LikeValue( $dbr->anyString(), '/', $dbr->anyString() )
52 );
53 }
54
55 // Don't select redirects
56 public function isRedirect() {
57 return false;
58 }
59}
60
65class_alias( SpecialRandomRootPage::class, 'SpecialRandomRootPage' );
Redirect to a random page that isn't a subpage.
__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( $domain=false, $group=null)
Get connection to a replica database.