MediaWiki  REL1_19
PrefixSearch Class Reference

PrefixSearch - Handles searching prefixes of titles and finding any page names that match. More...

List of all members.

Static Public Member Functions

static titleSearch ($search, $limit, $namespaces=array())
 Do a prefix search of titles and return a list of matching page names.

Static Protected Member Functions

static defaultSearchBackend ($namespaces, $search, $limit)
 Unless overridden by PrefixSearchBackend hook...
static searchBackend ($namespaces, $search, $limit)
 Do a prefix search of titles and return a list of matching page names.
static specialSearch ($search, $limit)
 Prefix search special-case for Special: namespace.
static validateNamespaces ($namespaces)
 Validate an array of numerical namespace indexes.

Detailed Description

PrefixSearch - Handles searching prefixes of titles and finding any page names that match.

Used largely by the OpenSearch implementation.

Definition at line 9 of file PrefixSearch.php.


Member Function Documentation

static PrefixSearch::defaultSearchBackend ( namespaces,
search,
limit 
) [static, protected]

Unless overridden by PrefixSearchBackend hook...

This is case-sensitive (First character may be automatically capitalized by Title::secureAndSpit() later on depending on $wgCapitalLinks)

Parameters:
$namespacesArray: namespaces to search in
$searchString: term
$limitInteger: max number of items to return
Returns:
Array of title strings

Definition at line 135 of file PrefixSearch.php.

References $limit.

Referenced by searchBackend().

Here is the caller graph for this function:

static PrefixSearch::searchBackend ( namespaces,
search,
limit 
) [static, protected]

Do a prefix search of titles and return a list of matching page names.

Parameters:
$namespacesArray
$searchString
$limitInteger
Returns:
Array of strings

Definition at line 55 of file PrefixSearch.php.

References $limit, defaultSearchBackend(), specialSearch(), and wfRunHooks().

Referenced by titleSearch().

Here is the call graph for this function:

Here is the caller graph for this function:

static PrefixSearch::specialSearch ( search,
limit 
) [static, protected]

Prefix search special-case for Special: namespace.

Parameters:
$searchString: term
$limitInteger: max number of items to return
Returns:
Array

Definition at line 78 of file PrefixSearch.php.

References $keys, $limit, $page, $wgContLang, SpecialPageFactory\getList(), Title\makeTitleSafe(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by searchBackend().

Here is the call graph for this function:

Here is the caller graph for this function:

static PrefixSearch::titleSearch ( search,
limit,
namespaces = array() 
) [static]

Do a prefix search of titles and return a list of matching page names.

Parameters:
$searchString
$limitInteger
$namespacesArray: used if query is not explicitely prefixed
Returns:
Array of strings

Definition at line 18 of file PrefixSearch.php.

References $limit, $title, Title\newFromText(), searchBackend(), and validateNamespaces().

Referenced by ApiOpenSearch\execute().

Here is the call graph for this function:

Here is the caller graph for this function:

static PrefixSearch::validateNamespaces ( namespaces) [static, protected]

Validate an array of numerical namespace indexes.

Parameters:
$namespacesArray
Returns:
Array (default: contains only NS_MAIN)

Definition at line 174 of file PrefixSearch.php.

References $wgContLang.

Referenced by titleSearch().

Here is the caller graph for this function:


The documentation for this class was generated from the following file: