use ParserCache;
use ParserOptions;
use ParserOutput;
+use Psr\Log\LoggerAwareInterface;
+use Psr\Log\LoggerInterface;
+use Psr\Log\NullLogger;
use RecentChangesUpdateJob;
use ResourceLoaderWikiModule;
use Revision;
* @since 1.32
* @ingroup Page
*/
-class DerivedPageDataUpdater implements IDBAccessObject {
+class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface {
/**
* @var UserIdentity|null
*/
private $loadbalancerFactory;
+ /**
+ * @var LoggerInterface
+ */
+ private $logger;
+
/**
* @var string see $wgArticleCountMethod
*/
// XXX only needed for waiting for replicas to catch up; there should be a narrower
// interface for that.
$this->loadbalancerFactory = $loadbalancerFactory;
+ $this->logger = new NullLogger();
+ }
+
+ public function setLogger( LoggerInterface $logger ) {
+ $this->logger = $logger;
}
/**
}
}
- /**
- * @return bool|string
- */
- private function getWikiId() {
- // TODO: get from RevisionStore
- return false;
- }
-
/**
* Checks whether this DerivedPageDataUpdater can be re-used for running updates targeting
* the given revision.
if ( $stashedEdit ) {
/** @var ParserOutput $output */
$output = $stashedEdit->output;
-
// TODO: this should happen when stashing the ParserOutput, not now!
$output->setCacheTime( $stashedEdit->timestamp );
$renderHints['known-revision-output'] = $output;
+
+ $this->logger->debug( __METHOD__ . ': using stashed edit output...' );
}
// NOTE: we want a canonical rendering, so don't pass $this->user or ParserOptions
// TODO: In the wiring, register a listener for this on the new PageEventEmitter
ResourceLoaderWikiModule::invalidateModuleCache(
- $title, $oldLegacyRevision, $legacyRevision, $this->getWikiId() ?: wfWikiID()
+ $title,
+ $oldLegacyRevision,
+ $legacyRevision,
+ $this->loadbalancerFactory->getLocalDomainID()
);
$this->doTransition( 'done' );