50 parent::__construct(
'Shortpages' );
64 'page_namespace' => array_diff(
65 $this->namespaceInfo->getContentNamespaces(),
66 $config->get(
'ShortPagesNamespaceExclusions' )
68 'page_is_redirect' => 0
71 $options = [
'USE INDEX' => [
'page' =>
'page_redirect_namespace_len' ] ];
74 $this->
getHookRunner()->onShortPagesQuery( $tables, $conds, $joinConds, $options );
79 'namespace' =>
'page_namespace',
80 'title' =>
'page_title',
84 'join_conds' => $joinConds,
90 $fname = static::class .
'::reallyDoQuery';
96 foreach ( $order as &$field ) {
101 $tables = isset( $query[
'tables'] ) ? (array)$query[
'tables'] : [];
102 $fields = isset( $query[
'fields'] ) ? (array)$query[
'fields'] : [];
103 $conds = isset( $query[
'conds'] ) ? (array)$query[
'conds'] : [];
104 $options = isset( $query[
'options'] ) ? (array)$query[
'options'] : [];
105 $join_conds = isset( $query[
'join_conds'] ) ? (array)$query[
'join_conds'] : [];
108 $options[
'LIMIT'] = intval(
$limit );
112 $options[
'OFFSET'] = intval(
$offset );
115 $namespaces = $conds[
'page_namespace'];
116 if ( count( $namespaces ) === 1 ) {
117 $options[
'ORDER BY'] = $order;
118 $res =
$dbr->select( $tables, $fields, $conds, $fname,
119 $options, $join_conds
122 unset( $conds[
'page_namespace'] );
123 $options[
'INNER ORDER BY'] = $order;
124 $options[
'ORDER BY'] = [
'value' . ( $this->
sortDescending() ?
' DESC' :
'' ) ];
125 $sql =
$dbr->unionConditionPermutations(
128 [
'page_namespace' => $namespaces ],
141 return [
'page_len' ];
164 $title = Title::makeTitleSafe( $result->namespace, $result->title );
166 return Html::element(
'span', [
'class' =>
'mw-invalidtitle' ],
173 $this->
msg(
'hist' )->text(),
175 [
'action' =>
'history' ]
177 $hlinkInParentheses = $this->
msg(
'parentheses' )->rawParams( $hlink )->escaped();
181 $exists =
$title->exists();
187 $size = $this->
msg(
'nbytes' )->numParams( $result->value )->escaped();
190 ?
"{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]"
191 :
"<del>{$hlinkInParentheses} {$dm}{$plink} {$dm}[{$size}]</del>";
195 return 'maintenance';
static getInvalidTitleDescription(IContextSource $context, $namespace, $title)
Get a message saying that an invalid title was encountered.
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)
LinkBatchFactory null $linkBatchFactory
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)
ILoadBalancer null $loadBalancer
getRecacheDB()
Get a DB connection to be used for slow recache queries.
getContext()
Gets the context this SpecialPage is executed in.
LinkRenderer null $linkRenderer
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()
Sometime we don't want to build rss / atom feeds.
__construct(NamespaceInfo $namespaceInfo, ILoadBalancer $loadBalancer, LinkBatchFactory $linkBatchFactory)
formatResult( $skin, $result)
NamespaceInfo $namespaceInfo