/** * Shows an overview * * @return void */ public function indexAction() { $product = $this->productRepository->findOneByName($this->settings['productName']); if ($product !== NULL) { $this->view->assign('branches', $product->getBranches()); } }
/** * Adds a release download * * This command adds a download with one or more formats to the given release. * The release must be prepared already. * * Besides the product name, version and label the downloads must be specified as * additional unnamed arguments. Each argument must contain the following * information separated by comma: * * - filename * - sha1 * - download url * * Example: * * adddownload FLOW3 1.0.0 "Base Distribution" flow3.tgz,de10397b180f636961cad6a5 * 8ae7d0ff9e3ef5d6,http://sf.net/foo flow3.zip,de10397b180f636961cad6a58ae7d0f * f9e3ef5d6,http://sf.net/bar * * @param string $productName The product name * @param string $version The release version, for example "1.3.4" * @param string $label Label for the downlaod * @return void */ public function addDownloadCommand($productName, $version, $label) { $product = $this->productRepository->findOneByName($productName); if ($product === NULL) { $this->outputLine('Product "%s" does not exist.', array($productName)); $this->quit(1); } $branchVersion = implode('.', array_slice(explode('.', $version), 0, 2)); $branch = $product->getBranch($branchVersion); if ($branch === NULL) { $this->outputLine('Branch "%s" does not exist.', array($branchVersion)); $this->quit(2); } $release = $branch->getRelease($version); if ($release === NULL) { $this->outputLine('A release for "%s" has not been prepared yet.', array($version)); $this->quit(3); } $download = new Download($release); $download->setLabel($label); $count = 0; foreach ($this->request->getExceedingArguments() as $argument) { list($filename, $sha1, $url) = explode(',', $argument); $downloadFormat = new \TYPO3\Release\Domain\Model\DownloadFormat($download, $filename, $sha1, $url); $download->addFormat($downloadFormat); $count++; } $release->addDownload($download); $this->productRepository->update($product); $this->outputLine('Added %s new downloads for %s %s.', array($count, $productName, $version)); }