MediaWiki  1.28.0
ProtectedTitlesPager.php
Go to the documentation of this file.
1 <?php
26 
27  public $mForm, $mConds;
28 
29  function __construct( $form, $conds = [], $type, $level, $namespace,
30  $sizetype = '', $size = 0
31  ) {
32  $this->mForm = $form;
33  $this->mConds = $conds;
34  $this->level = $level;
35  $this->namespace = $namespace;
36  $this->size = intval( $size );
37  parent::__construct( $form->getContext() );
38  }
39 
40  function getStartBody() {
41  # Do a link batch query
42  $this->mResult->seek( 0 );
43  $lb = new LinkBatch;
44 
45  foreach ( $this->mResult as $row ) {
46  $lb->add( $row->pt_namespace, $row->pt_title );
47  }
48 
49  $lb->execute();
50 
51  return '';
52  }
53 
57  function getTitle() {
58  return $this->mForm->getTitle();
59  }
60 
61  function formatRow( $row ) {
62  return $this->mForm->formatRow( $row );
63  }
64 
68  function getQueryInfo() {
69  $conds = $this->mConds;
70  $conds[] = 'pt_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
71  ' OR pt_expiry IS NULL';
72  if ( $this->level ) {
73  $conds['pt_create_perm'] = $this->level;
74  }
75 
76  if ( !is_null( $this->namespace ) ) {
77  $conds[] = 'pt_namespace=' . $this->mDb->addQuotes( $this->namespace );
78  }
79 
80  return [
81  'tables' => 'protected_titles',
82  'fields' => [ 'pt_namespace', 'pt_title', 'pt_create_perm',
83  'pt_expiry', 'pt_timestamp' ],
84  'conds' => $conds
85  ];
86  }
87 
88  function getIndexField() {
89  return 'pt_timestamp';
90  }
91 }
IndexPager with an alphabetic list and a formatted navigation bar.
__construct($form, $conds=[], $type, $level, $namespace, $sizetype= '', $size=0)
Class representing a list of titles The execute() method checks them all for existence and adds them ...
Definition: LinkBatch.php:32
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
add($ns, $dbkey)
Definition: LinkBatch.php:79
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk my contributions etc etc otherwise the built in rate limiting checks are if enabled allows for interception of redirect as a string mapping parameter names to values & $type
Definition: hooks.txt:2491