/** * 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; }
/** * 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))); }