MediaWiki REL1_33
SpecialUncategorizedcategories.php
Go to the documentation of this file.
1<?php
35 private $exceptionList = null;
36
37 function __construct( $name = 'Uncategorizedcategories' ) {
38 parent::__construct( $name );
39 $this->requestedNamespace = NS_CATEGORY;
40 }
41
48 private function getExceptionList() {
49 if ( $this->exceptionList === null ) {
50 $exList = $this->msg( 'uncategorized-categories-exceptionlist' )
51 ->inContentLanguage()->plain();
52 $proposedTitles = explode( "\n", $exList );
53 foreach ( $proposedTitles as $count => $titleStr ) {
54 if ( strpos( $titleStr, '*' ) !== 0 ) {
55 continue;
56 }
57 $titleStr = preg_replace( "/^\\*\\s*/", '', $titleStr );
58 $title = Title::newFromText( $titleStr, NS_CATEGORY );
59 if ( $title && $title->getNamespace() !== NS_CATEGORY ) {
60 $title = Title::makeTitleSafe( NS_CATEGORY, $titleStr );
61 }
62 if ( $title ) {
63 $this->exceptionList[] = $title->getDBkey();
64 }
65 }
66 }
68 }
69
70 public function getQueryInfo() {
72 $query = parent::getQueryInfo();
74 if ( $exceptionList ) {
75 $query['conds'][] = 'page_title not in ( ' . $dbr->makeList( $exceptionList ) . ' )';
76 }
77
78 return $query;
79 }
80
87 function formatResult( $skin, $result ) {
88 $title = Title::makeTitle( NS_CATEGORY, $result->title );
89 $text = $title->getText();
90
91 return $this->getLinkRenderer()->makeKnownLink( $title, $text );
92 }
93}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
msg( $key)
Wrapper around wfMessage that sets the current context.
A special page that lists uncategorized categories.
__construct( $name='Uncategorizedcategories')
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
array $exceptionList
Holds a list of categories, which shouldn't be listed on this special page, even if it is uncategoriz...
getExceptionList()
Returns an array of category titles (usually without the namespace), which shouldn't be listed on thi...
formatResult( $skin, $result)
Formats the result.
A special page looking for page without any category.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
Definition hooks.txt:1617
const NS_CATEGORY
Definition Defines.php:87
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
const DB_REPLICA
Definition defines.php:25