本文整理汇总了PHP中SMW\ApplicationFactory::getCache方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationFactory::getCache方法的具体用法?PHP ApplicationFactory::getCache怎么用?PHP ApplicationFactory::getCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMW\ApplicationFactory
的用法示例。
在下文中一共展示了ApplicationFactory::getCache方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkForRequestedUpdateByPagePurge
/**
* @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;
}
示例2: checkForRequestedUpdateByPagePurge
/**
* @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;
}
示例3: updateStore
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;
}
示例4: checkForRequestedUpdateByPagePurge
/**
* @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;
}
示例5: checkForRequestedUpdateByPagePurge
/**
* @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;
}