MediaWiki master
SpecialRandomRootPage.php
Go to the documentation of this file.
1<?php
2
27namespace MediaWiki\Specials;
28
33
35
40 public function __construct(
41 IConnectionProvider $dbProvider,
42 NamespaceInfo $nsInfo
43 ) {
44 parent::__construct( $dbProvider, $nsInfo );
45 $this->mName = 'Randomrootpage';
46 $dbr = $dbProvider->getReplicaDatabase();
47 $this->extra[] = $dbr->expr(
48 'page_title',
49 IExpression::NOT_LIKE,
50 new LikeValue( $dbr->anyString(), '/', $dbr->anyString() )
51 );
52 }
53
54 // Don't select redirects
55 public function isRedirect() {
56 return false;
57 }
58}
59
64class_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...
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.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Ge...