| @@ 60-66 (lines=7) @@ | ||
| 57 | * Initialize any services we'll need (unless it has already been provided via a setter). |
|
| 58 | * This allows for dependency injection even though we don't control object creation. |
|
| 59 | */ |
|
| 60 | private function initServices() { |
|
| 61 | if ( !$this->linkRenderer ) { |
|
| 62 | $lang = $this->getContext()->getLanguage(); |
|
| 63 | $titleFormatter = new MediaWikiTitleCodec( $lang, GenderCache::singleton() ); |
|
| 64 | $this->linkRenderer = new MediaWikiPageLinkRenderer( $titleFormatter ); |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| 68 | public function execute( $par ) { |
|
| 69 | $this->initServices(); |
|
| @@ 70-76 (lines=7) @@ | ||
| 67 | * Initialize any services we'll need (unless it has already been provided via a setter). |
|
| 68 | * This allows for dependency injection even though we don't control object creation. |
|
| 69 | */ |
|
| 70 | private function initServices() { |
|
| 71 | global $wgContLang; |
|
| 72 | if ( !$this->linkRenderer ) { |
|
| 73 | $titleFormatter = new MediaWikiTitleCodec( $wgContLang, GenderCache::singleton() ); |
|
| 74 | $this->linkRenderer = new MediaWikiPageLinkRenderer( $titleFormatter ); |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||
| 78 | function isCacheable() { |
|
| 79 | return false; |
|