Permalink
Browse files

Pass $forceRefresh parameter to the node.info.* hooks. The cache uses…

… it to make sure to clear itself.
  • Loading branch information...
1 parent b7e448d commit f757b326f88a613816cb752d66efeb45b453b1f1 @cdujeu cdujeu committed May 20, 2016
@@ -423,12 +423,12 @@ public function loadNodeInfo($forceRefresh = false, $contextNode = false, $detai
if(is_object($driver)) $driver->detectStreamWrapper(true);
}
}
- Controller::applyHook("node.info.start", array(&$this, $contextNode, $details));
+ Controller::applyHook("node.info.start", array(&$this, $contextNode, $details, $forceRefresh));
if($this->nodeInfoLoaded && !$forceRefresh){
return;
}
- Controller::applyHook("node.info", array(&$this, $contextNode, $details));
- Controller::applyHook("node.info.end", array(&$this, $contextNode, $details));
+ Controller::applyHook("node.info", array(&$this, $contextNode, $details, $forceRefresh));
+ Controller::applyHook("node.info.end", array(&$this, $contextNode, $details, $forceRefresh));
$this->nodeInfoLoaded = true;
$this->nodeInfoLevel = $details;
}
@@ -20,9 +20,9 @@
*/
namespace Pydio\Cache\Core;
use Pydio\Access\Core\AJXP_MetaStreamWrapper;
+use Pydio\Access\Core\Model\Repository;
use Pydio\Core\Services\CacheService;
use Pydio\Core\Services\ConfService;
-use Pydio\Core\Utils\Utils;
use Pydio\Core\Controller\HTMLWriter;
use Pydio\Core\PluginFramework\Plugin;
use Pydio\Core\PluginFramework\PluginsService;
@@ -83,8 +83,13 @@ public function cacheNodeInfo(&$node, $contextNode, $details){
* @param \Pydio\Access\Core\Model\AJXP_Node $node
* @param AJXP_Node $contextNode
* @param bool $details
+ * @param bool $forceRefresh
*/
- public function loadNodeInfoFromCache(&$node, $contextNode, $details){
+ public function loadNodeInfoFromCache(&$node, $contextNode, $details, $forceRefresh = false){
+ if($forceRefresh) {
+ $this->clearNodeInfoCache($node);
+ return;
+ }
$cDriver = ConfService::getCacheDriverImpl();
if(empty($cDriver) || !($cDriver->supportsPatternDelete(AJXP_CACHE_SERVICE_NS_NODES))){
return;
@@ -55,7 +55,6 @@ public function applyAction(\Psr\Http\Message\ServerRequestInterface $requestInt
if ($actionName == "index") {
$repository = ConfService::getRepository();
- $repositoryId = $repository->getId();
$userSelection = new UserSelection($repository, $httpVars);
if($userSelection->isEmpty()){
$userSelection->addFile("/");

0 comments on commit f757b32

Please sign in to comment.