Пример #1
0
 /**
  * Produce page output suitable for indexing.
  *
  * Specific content handlers may override it if they need different content handling.
  *
  * @param WikiPage    $page
  * @param ParserCache $cache
  * @return ParserOutput
  */
 public function getParserOutputForIndexing(WikiPage $page, ParserCache $cache = null)
 {
     $parserOptions = $page->makeParserOptions('canonical');
     $revId = $page->getRevision()->getId();
     if ($cache) {
         $parserOutput = $cache->get($page, $parserOptions);
     }
     if (empty($parserOutput)) {
         $parserOutput = $page->getContent()->getParserOutput($page->getTitle(), $revId, $parserOptions);
         if ($cache) {
             $cache->save($parserOutput, $page, $parserOptions);
         }
     }
     return $parserOutput;
 }