Go to the documentation of this file.
37 parent::__construct( $name );
46 $blacklist = $config->get(
'ShortPagesNamespaceBlacklist' );
49 'page_namespace' => array_diff(
50 MediaWikiServices::getInstance()->getNamespaceInfo()->getContentNamespaces(),
53 'page_is_redirect' => 0
56 $options = [
'USE INDEX' => [
'page' =>
'page_redirect_namespace_len' ] ];
59 Hooks::run(
'ShortPagesQuery', [ &$tables, &$conds, &$joinConds, &$options ] );
64 'namespace' =>
'page_namespace',
65 'title' =>
'page_title',
69 'join_conds' => $joinConds,
75 $fname = static::class .
'::reallyDoQuery';
81 foreach ( $order as &$field ) {
86 $tables = isset( $query[
'tables'] ) ? (array)$query[
'tables'] : [];
87 $fields = isset( $query[
'fields'] ) ? (array)$query[
'fields'] : [];
88 $conds = isset( $query[
'conds'] ) ? (array)$query[
'conds'] : [];
89 $options = isset( $query[
'options'] ) ? (array)$query[
'options'] : [];
90 $join_conds = isset( $query[
'join_conds'] ) ? (array)$query[
'join_conds'] : [];
93 $options[
'LIMIT'] = intval(
$limit );
97 $options[
'OFFSET'] = intval(
$offset );
100 $namespaces = $conds[
'page_namespace'];
101 if ( count( $namespaces ) === 1 ) {
102 $options[
'ORDER BY'] = $order;
103 $res =
$dbr->select( $tables, $fields, $conds, $fname,
104 $options, $join_conds
107 unset( $conds[
'page_namespace'] );
108 $options[
'INNER ORDER BY'] = $order;
109 $options[
'ORDER BY'] = [
'value' . ( $this->
sortDescending() ?
' DESC' :
'' ) ];
110 $sql =
$dbr->unionConditionPermutations(
113 [
'page_namespace' => $namespaces ],
126 return [
'page_len' ];
151 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ],
158 $this->
msg(
'hist' )->text(),
160 [
'action' =>
'history' ]
162 $hlinkInParentheses = $this->
msg(
'parentheses' )->rawParams( $hlink )->escaped();
166 $exists =
$title->exists();
172 $size = $this->
msg(
'nbytes' )->numParams( $result->value )->escaped();
175 ?
"${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
176 :
"<del>${hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
180 return 'maintenance';
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
getOrderFields()
Subclasses return an array of fields to order by here.
getLanguage()
Shortcut to get user's language.
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
isSyndicated()
Sometime we don't want to build rss / atom feeds.
This is a class for doing query pages; since they're almost all the same, we factor out some of the f...
executeLBFromResultWrapper(IResultWrapper $res, $ns=null)
Creates a new LinkBatch object, adds all pages from the passed result wrapper (MUST include title and...
int $offset
The offset and limit in use, as passed to the query() function.
getConfig()
Shortcut to get main config object.
preprocessResults( $db, $res)
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
formatResult( $skin, $result)
SpecialShortpages extends QueryPage.
getRecacheDB()
Get a DB connection to be used for slow recache queries.
getContext()
Gets the context this SpecialPage is executed in.
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
__construct( $name='Shortpages')
reallyDoQuery( $limit, $offset=false)
Run the query and return the result.
sortDescending()
Override to sort by increasing values.
MediaWiki Linker LinkRenderer null $linkRenderer
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.