cache = $cache; $this->cacheable = true; } /** * @return Status */ public function doWork() { // Reduce effects of race conditions for slow parses (T48014) $cacheTime = wfTimestampNow(); $status = $this->renderRevision(); /** @var ParserOutput|null $output */ $output = $status->getValue(); if ( $output && $output->isCacheable() ) { $this->cache->save( $output, $this->revision, $this->parserOptions, $cacheTime ); } return $status; } /** * @return Status|false */ public function getCachedWork() { $parserOutput = $this->cache->get( $this->revision, $this->parserOptions ); return $parserOutput ? Status::newGood( $parserOutput ) : false; } }