Esempio n. 1
0
 /**
  * Gets the provided module with a specific version
  * @param string $namespace The namespace of the module
  * @param string $name The name of the module
  * @param string $atLeastVersion The version of the module
  * @return string Base64 encoded string of the phar file of the module
  */
 public function getModuleVersion($namespace, $name, $version)
 {
     $file = $this->repository->getModuleFileForVersion($namespace, $name, $version);
     return $this->getBase64FromFile($file);
 }
 /**
  * Action to download a module
  * @param string $namespace The namespace of the module
  * @param string $name The name of the module
  * @param string $version The version of the module
  * @return null
  */
 public function downloadAction($namespace = null, $name = null, $version = null)
 {
     try {
         $file = $this->repository->getModuleFileForVersion($namespace, $name, $version);
     } catch (ModuleNotFoundException $exception) {
         $this->setError404();
         return;
     }
     $view = new DownloadView($file);
     $this->response->setView($view);
 }