コード例 #1
0
ファイル: Cache.php プロジェクト: ClaudioThomas/shopware-4
 /**
  * Returns a given cache info item
  * @param $cache
  * @return array
  * @throws \Shopware\Components\Api\Exception\NotFoundException
  */
 private function getCacheInfo($cache)
 {
     switch ($cache) {
         case 'http':
             $cacheInfo = $this->cacheManager->getHttpCacheInfo();
             break;
         case 'config':
             $cacheInfo = $this->cacheManager->getConfigCacheInfo();
             break;
         case 'template':
             $cacheInfo = $this->cacheManager->getTemplateCacheInfo();
             break;
         case 'proxy':
             $cacheInfo = $this->cacheManager->getShopwareProxyCacheInfo();
             break;
         case 'doctrine-proxy':
             $cacheInfo = $this->cacheManager->getDoctrineProxyCacheInfo();
             break;
         case 'doctrine-file':
             $cacheInfo = $this->cacheManager->getDoctrineFileCacheInfo();
             break;
         default:
             throw new ApiException\NotFoundException("Cache {$cache} is not a valid cache id.");
     }
     $cacheInfo['id'] = $cache;
     return $cacheInfo;
 }
コード例 #2
0
ファイル: Cache.php プロジェクト: Goucher/shopware
 /**
  * Cache info action
  */
 public function getInfoAction()
 {
     $data = array($this->cacheManager->getConfigCacheInfo(), $this->cacheManager->getHttpCacheInfo($this->Request()), $this->cacheManager->getTemplateCacheInfo(), $this->cacheManager->getThemeCacheInfo(), $this->cacheManager->getShopwareProxyCacheInfo(), $this->cacheManager->getDoctrineFileCacheInfo(), $this->cacheManager->getDoctrineProxyCacheInfo());
     $this->View()->assign(array('success' => true, 'data' => $data, 'total' => count($data)));
 }