Go to the documentation of this file.
53 $search = trim( $search );
54 if ( $search ==
'' ) {
96 $fallbackLimit =
$limit - count( $searches );
97 if ( $fallbackLimit > 0 ) {
100 $fallbackSearches =
$wgContLang->autoConvertToAllVariants( $search );
101 $fallbackSearches = array_diff( array_unique( $fallbackSearches ),
array( $search ) );
103 foreach ( $fallbackSearches
as $fbs ) {
105 $searches = array_merge( $searches, $fallbackSearchResult );
106 $fallbackLimit -= count( $fallbackSearchResult );
108 if ( $fallbackLimit == 0 ) {
156 return $this->
strings( $srchres );
169 # normalize searchKey, so aliases with spaces can be found - bug 25675
170 $search = str_replace(
' ',
'_', $search );
181 foreach (
$wgContLang->getSpecialPageAliases()
as $page => $aliases ) {
186 foreach ( $aliases
as $alias ) {
193 foreach (
$keys as $pageKey => $page ) {
194 if ( $searchKey ===
'' || strpos( $pageKey, $searchKey ) === 0 ) {
202 if ( count( $srchres ) >=
$limit ) {
228 $prefix =
$t ?
$t->getDBkey() :
'';
231 array(
'page_id',
'page_namespace',
'page_title' ),
233 'page_namespace' => $ns,
234 'page_title ' .
$dbr->buildLike( $prefix,
$dbr->anyString() )
237 array(
'LIMIT' =>
$limit,
'ORDER BY' =>
'page_title' )
240 foreach (
$res as $row ) {
260 if ( is_numeric( $ns ) && array_key_exists( $ns, $validNamespaces ) ) {
264 if ( count( $valid ) > 0 ) {
284 $titles = array_map(
'Title::newFromText', $strings );
286 $lb->setCaller( __METHOD__ );
299 return array_map(
function(
Title $t ) {
return $t->getPrefixedText(); },
$titles );
static getList()
Get the special page list.
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Performs prefix search, returning Title objects.
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
titles(array $titles)
When implemented in a descendant class, receives an array of Title objects and returns either an unmo...
wfProfileIn( $functionname)
Begin profiling of a function.
specialSearch( $search, $limit)
Prefix search special-case for Special: namespace.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the content language as $wgContLang
strings(array $strings)
When implemented in a descendant class, receives an array of titles as strings and returns either an ...
if( $wgAPIRequestLog) $lb
static titleSearch( $search, $limit, $namespaces=array())
Do a prefix search of titles and return a list of matching page names.
linkcache txt The LinkCache class maintains a list of article titles and the information about whether or not the article exists in the database This is used to mark up links when displaying a page If the same link appears more than once on any page then it only has to be looked up once In most cases link lookups are done in batches with the LinkBatch class or the equivalent in so the link cache is mostly useful for short snippets of parsed and for links in the navigation areas of the skin The link cache was formerly used to track links used in a document for the purposes of updating the link tables This application is now deprecated To create a you can use the following $titles
static newFromRow( $row)
Make a Title object from a DB row.
strings(array $strings)
When implemented in a descendant class, receives an array of titles as strings and returns either an ...
wfProfileOut( $functionname='missing')
Stop profiling of a function.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
searchBackend( $namespaces, $search, $limit)
Do a prefix search of titles and return a list of matching page names.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
searchWithVariants( $search, $limit, array $namespaces)
Do a prefix search for all possible variants of the prefix.
defaultSearchBackend( $namespaces, $search, $limit)
Unless overridden by PrefixSearchBackend hook...
titles(array $titles)
When implemented in a descendant class, receives an array of Title objects and returns either an unmo...
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
presenting them properly to the user as errors is done by the caller $title
validateNamespaces( $namespaces)
Validate an array of numerical namespace indexes.
strings(array $strings)
When implemented in a descendant class, receives an array of titles as strings and returns either an ...
search( $search, $limit, $namespaces=array())
Do a prefix search of titles and return a list of matching page names.
Represents a title within MediaWiki.
namespace and then decline to actually register it & $namespaces
Handles searching prefixes of titles and finding any page names that match.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Performs prefix search, returning strings.
titles(array $titles)
When implemented in a descendant class, receives an array of Title objects and returns either an unmo...