Exemple #1
0
 /**
  * This event handler lists all activated modules with the description
  * of each module.
  * 
  * @access public
  * @param \Zepi\Turbo\Framework $framework
  * @param \Zepi\Turbo\Request\WebRequest $request
  * @param \Zepi\Turbo\Response\Response $response
  */
 public function execute(Framework $framework, WebRequest $request, Response $response, $value = null)
 {
     // Get the route params
     $type = $request->getRouteParam('type');
     // Type of the asset
     $hash = $request->getRouteParam('hash');
     // Hash of the asset
     $version = $request->getRouteParam('version');
     // Version of the file
     // Check if all values are available
     if ($type == false || $hash == false || $version == false) {
         $response->setOutput('/** Zepi Assets Manager: Malformed request! */');
         return;
     }
     // If the file isn't cached display nothing
     if (!$this->assetCacheManager->isCached($type, $hash, $version)) {
         $response->setOutput('/** Zepi Assets Manager: Not cached! */');
         return;
     }
     // Load the content
     $content = $this->assetCacheManager->getAssetContent($type, $hash, $version);
     if ($content === '') {
         $content = '/** Zepi Assets Manager: File is empty or does not exists! */';
     }
     $this->deliverContent($response, $type, $hash, $version, $content);
 }