MediaWiki master
SpecialRandomRootPage.php
Go to the documentation of this file.
1<?php
23namespace MediaWiki\Specials;
24
29
36
37 public function __construct(
38 IConnectionProvider $dbProvider,
39 NamespaceInfo $nsInfo
40 ) {
41 parent::__construct( $dbProvider, $nsInfo );
42 $this->mName = 'Randomrootpage';
43 $dbr = $dbProvider->getReplicaDatabase();
44 $this->extra[] = $dbr->expr(
45 'page_title',
46 IExpression::NOT_LIKE,
47 new LikeValue( $dbr->anyString(), '/', $dbr->anyString() )
48 );
49 }
50
51 // Don't select redirects
52 public function isRedirect() {
53 return false;
54 }
55}
56
61class_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.