コード例 #1
0
ファイル: InvalidLicenses.php プロジェクト: piwik/piwik
 public function getPluginNamesOfInvalidLicenses()
 {
     // it is very important this is cached, otherwise performance may decrease a lot. Eager cache is currently
     // cached for 12 hours. In case we lower ttl for eager cache it might be worth considering to change to another
     // cache
     if ($this->cache->contains($this->cacheKey)) {
         $expiredPlugins = $this->cache->fetch($this->cacheKey);
     } else {
         $expiredPlugins = $this->getPluginNamesToExpireInCaseLicenseIsInvalid();
         $this->cache->save($this->cacheKey, $expiredPlugins);
     }
     return $expiredPlugins;
 }
コード例 #2
0
ファイル: Plugin.php プロジェクト: nuxwin/piwik
 public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass)
 {
     $this->createCacheIfNeeded();
     $cacheId = 'Plugin' . $this->pluginName . $directoryWithinPlugin . $expectedSubclass;
     if ($this->cache->contains($cacheId)) {
         $components = $this->cache->fetch($cacheId);
         if ($this->includeComponents($components)) {
             return $components;
         } else {
             // problem including one cached file, refresh cache
         }
     }
     $components = $this->doFindMultipleComponents($directoryWithinPlugin, $expectedSubclass);
     $this->cache->save($cacheId, $components);
     return $components;
 }