Exemple #1
0
 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $cache->setKey(ArticlePurge::newCacheId($this->parser->getTitle()->getArticleID()));
     if ($cache->get()) {
         $cache->delete();
         $parserData->updateStore();
     }
     return true;
 }
 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key)) {
         $cache->delete($key);
         $parserData->updateStore();
     }
     return true;
 }
 private function updateStore($parserData)
 {
     $cache = $this->applicationFactory->getCache();
     $cache->setKey(FactboxCache::newCacheId($this->getTitle()->getArticleID()))->delete();
     // TODO
     // Rebuild the factbox
     // Set a different updateIndentifier to ensure that the updateJob
     // will force a comparison of old/new data during the store update
     $parserData->getSemanticData()->setUpdateIdentifier('update-job');
     $parserData->disableBackgroundUpdateJobs();
     $parserData->updateStore();
     return true;
 }
Exemple #4
0
 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     // Only carry out a purge where InTextAnnotationParser have set
     // an appropriate context reference otherwise it is assumed that the hook
     // call is part of another non SMW related parse
     if ($parserData->getSemanticData()->getSubject()->getContextReference() === null) {
         return true;
     }
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key) && $cache->fetch($key)) {
         $cache->delete($key);
         $parserData->updateStore();
     }
     return true;
 }
 /**
  * @note Article purge: In case an article was manually purged/moved
  * the store is updated as well; for all other cases LinksUpdateConstructed
  * will handle the store update
  *
  * @note The purge action is isolated from any other request therefore using
  * a static variable or any other messaging that is not persistent will not
  * work hence the reliance on the cache as temporary persistence marker
  */
 private function checkForRequestedUpdateByPagePurge($parserData)
 {
     // Only carry out a purge where InTextAnnotationParser have set
     // an appropriate context reference otherwise it is assumed that the hook
     // call is part of another non SMW related parse
     if ($parserData->getSemanticData()->getSubject()->getContextReference() === null) {
         return true;
     }
     $cache = $this->applicationFactory->getCache();
     $key = $this->applicationFactory->newCacheFactory()->getPurgeCacheKey($this->parser->getTitle()->getArticleID());
     if ($cache->contains($key) && $cache->fetch($key)) {
         $cache->delete($key);
         // Set a timestamp explicitly to create a new hash for the property
         // table change row differ and force a data comparison (this doesn't
         // change the _MDAT annotation)
         $parserData->getSemanticData()->setLastModified(wfTimestamp(TS_UNIX));
         $parserData->updateStore();
     }
     return true;
 }