42 private $namespaceInfo;
54 parent::__construct(
'Shortpages' );
55 $this->namespaceInfo = $namespaceInfo;
68 'page_namespace' => array_diff(
69 $this->namespaceInfo->getContentNamespaces(),
70 $config->get( MainConfigNames::ShortPagesNamespaceExclusions )
72 'page_is_redirect' => 0
75 $options = [
'USE INDEX' => [
'page' =>
'page_redirect_namespace_len' ] ];
78 $this->
getHookRunner()->onShortPagesQuery( $tables, $conds, $joinConds, $options );
83 'namespace' =>
'page_namespace',
84 'title' =>
'page_title',
88 'join_conds' => $joinConds,
94 $fname = static::class .
'::reallyDoQuery';
100 foreach ( $order as &$field ) {
105 $tables = isset( $query[
'tables'] ) ? (array)$query[
'tables'] : [];
106 $fields = isset( $query[
'fields'] ) ? (array)$query[
'fields'] : [];
107 $conds = isset( $query[
'conds'] ) ? (array)$query[
'conds'] : [];
108 $options = isset( $query[
'options'] ) ? (array)$query[
'options'] : [];
109 $join_conds = isset( $query[
'join_conds'] ) ? (array)$query[
'join_conds'] : [];
112 $options[
'LIMIT'] = intval(
$limit );
116 $options[
'OFFSET'] = intval(
$offset );
119 $namespaces = $conds[
'page_namespace'];
120 if ( count( $namespaces ) === 1 ) {
121 $options[
'ORDER BY'] = $order;
122 $res =
$dbr->select( $tables, $fields, $conds, $fname,
123 $options, $join_conds
126 unset( $conds[
'page_namespace'] );
127 $options[
'INNER ORDER BY'] = $order;
128 $options[
'ORDER BY'] = [
'value' . ( $this->
sortDescending() ?
' DESC' :
'' ) ];
129 $sql =
$dbr->unionConditionPermutations(
132 [
'page_namespace' => $namespaces ],
145 return [
'page_len' ];
168 $title = Title::makeTitleSafe( $result->namespace, $result->title );
170 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ],
171 Linker::getInvalidTitleDescription( $this->
getContext(), $result->namespace, $result->title ) );
175 $hlink = $linkRenderer->makeKnownLink(
177 $this->
msg(
'hist' )->text(),
179 [
'action' =>
'history' ]
181 $hlinkInParentheses = $this->
msg(
'parentheses' )->rawParams( $hlink )->escaped();
184 $plink = $linkRenderer->makeLink(
$title );
185 $exists =
$title->exists();
187 $plink = $linkRenderer->makeKnownLink(
$title );
191 $size = $this->
msg(
'nbytes' )->numParams( $result->value )->escaped();
194 ?
"{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
195 :
"<del>{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
199 return 'maintenance';
A class containing constants representing the names of configuration variables.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
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...
setDBLoadBalancer(ILoadBalancer $loadBalancer)
int $offset
The offset and limit in use, as passed to the query() function.
isCached()
Whether or not the output of the page in question is retrieved from the database cache.
setLinkBatchFactory(LinkBatchFactory $linkBatchFactory)
getRecacheDB()
Get a DB connection to be used for slow recache queries.
getContext()
Gets the context this SpecialPage is executed in.
msg( $key,... $params)
Wrapper around wfMessage that sets the current context.
getConfig()
Shortcut to get main config object.
getLanguage()
Shortcut to get user's language.
SpecialShortpages extends QueryPage.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
reallyDoQuery( $limit, $offset=false)
Run the query and return the result.
getQueryInfo()
Subclasses return an SQL query here, formatted as an array with the following keys: tables => Table(s...
preprocessResults( $db, $res)
sortDescending()
Override to sort by increasing values.
getOrderFields()
Subclasses return an array of fields to order by here.
isSyndicated()
Sometimes we don't want to build rss / atom feeds.
__construct(NamespaceInfo $namespaceInfo, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory)
formatResult( $skin, $result)