39 private $namespaceInfo;
51 parent::__construct(
'Shortpages' );
52 $this->namespaceInfo = $namespaceInfo;
65 'page_namespace' => array_diff(
66 $this->namespaceInfo->getContentNamespaces(),
67 $config->get( MainConfigNames::ShortPagesNamespaceExclusions )
69 'page_is_redirect' => 0
72 $options = [
'USE INDEX' => [
'page' =>
'page_redirect_namespace_len' ] ];
75 $this->
getHookRunner()->onShortPagesQuery( $tables, $conds, $joinConds, $options );
80 'namespace' =>
'page_namespace',
81 'title' =>
'page_title',
85 'join_conds' => $joinConds,
91 $fname = static::class .
'::reallyDoQuery';
97 foreach ( $order as &$field ) {
102 $tables = isset( $query[
'tables'] ) ? (array)$query[
'tables'] : [];
103 $fields = isset( $query[
'fields'] ) ? (array)$query[
'fields'] : [];
104 $conds = isset( $query[
'conds'] ) ? (array)$query[
'conds'] : [];
105 $options = isset( $query[
'options'] ) ? (array)$query[
'options'] : [];
106 $join_conds = isset( $query[
'join_conds'] ) ? (array)$query[
'join_conds'] : [];
109 $options[
'LIMIT'] = intval(
$limit );
113 $options[
'OFFSET'] = intval(
$offset );
116 $namespaces = $conds[
'page_namespace'];
117 if ( count( $namespaces ) === 1 ) {
118 $options[
'ORDER BY'] = $order;
119 $res =
$dbr->select( $tables, $fields, $conds, $fname,
120 $options, $join_conds
123 unset( $conds[
'page_namespace'] );
124 $options[
'INNER ORDER BY'] = $order;
125 $options[
'ORDER BY'] = [
'value' . ( $this->
sortDescending() ?
' DESC' :
'' ) ];
126 $sql =
$dbr->unionConditionPermutations(
129 [
'page_namespace' => $namespaces ],
142 return [
'page_len' ];
165 $title = Title::makeTitleSafe( $result->namespace, $result->title );
167 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ],
172 $hlink = $linkRenderer->makeKnownLink(
174 $this->
msg(
'hist' )->text(),
176 [
'action' =>
'history' ]
178 $hlinkInParentheses = $this->
msg(
'parentheses' )->rawParams( $hlink )->escaped();
181 $plink = $linkRenderer->makeLink(
$title );
182 $exists =
$title->exists();
184 $plink = $linkRenderer->makeKnownLink(
$title );
188 $size = $this->
msg(
'nbytes' )->numParams( $result->value )->escaped();
191 ?
"{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
192 :
"<del>{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
196 return 'maintenance';
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
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)