/** @var array|bool */
private $mungedQuery = false;
- /**
- * @var PageLinkRenderer
- */
- protected $linkRenderer = null;
-
function setParams( $params ) {
$this->mQuery = $params['query'];
$this->mNs = $params['namespace'];
// using the setServices() method.
}
- /**
- * Initialize or override the PageLinkRenderer LinkSearchPage collaborates with.
- * Useful mainly for testing.
- *
- * @todo query logic and rendering logic should be split and also injected
- *
- * @param PageLinkRenderer $linkRenderer
- */
- public function setPageLinkRenderer(
- PageLinkRenderer $linkRenderer
- ) {
- $this->linkRenderer = $linkRenderer;
- }
-
- /**
- * Initialize any services we'll need (unless it has already been provided via a setter).
- * This allows for dependency injection even though we don't control object creation.
- */
- private function initServices() {
- global $wgContLang;
- if ( !$this->linkRenderer ) {
- $titleFormatter = new MediaWikiTitleCodec( $wgContLang, GenderCache::singleton() );
- $this->linkRenderer = new MediaWikiPageLinkRenderer( $titleFormatter );
- }
- }
-
function isCacheable() {
return false;
}
public function execute( $par ) {
- $this->initServices();
-
$this->setHeaders();
$this->outputHeader();
*/
static function mungeQuery( $query, $prot ) {
$field = 'el_index';
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
if ( $query === '*' && $prot !== '' ) {
// Allow queries like 'ftp://*' to find all ftp links
}
public function getQueryInfo() {
- $dbr = wfGetDB( DB_SLAVE );
+ $dbr = wfGetDB( DB_REPLICA );
// strip everything past first wildcard, so that
// index-based-only lookup would be done
list( $this->mungedQuery, $clause ) = self::mungeQuery( $this->mQuery, $this->mProt );
*/
function formatResult( $skin, $result ) {
$title = new TitleValue( (int)$result->namespace, $result->title );
- $pageLink = $this->linkRenderer->renderHtmlLink( $title );
+ $pageLink = $this->getLinkRenderer()->makeLink( $title );
$url = $result->url;
$urlLink = Linker::makeExternalLink( $url, $url );
protected function getGroupName() {
return 'redirects';
}
+
+ /**
+ * enwiki complained about low limits on this special page
+ *
+ * @see T130058
+ * @todo FIXME This special page should not use LIMIT for paging
+ */
+ protected function getMaxResults() {
+ return max( parent::getMaxResults(), 60000 );
+ }
}