/** * Create a new package * * This command creates a new package which contains only the mandatory * directories and files. * * @FLOW3\FlushesCaches * @param string $packageKey The package key of the package to create * @return string * @see typo3.kickstart:kickstart:package */ public function createCommand($packageKey) { if (!$this->packageManager->isPackageKeyValid($packageKey)) { $this->outputLine('The package key "%s" is not valid.', array($packageKey)); $this->quit(1); } if ($this->packageManager->isPackageAvailable($packageKey)) { $this->outputLine('The package "%s" already exists.', array($packageKey)); $this->quit(1); } $package = $this->packageManager->createPackage($packageKey); $this->outputLine('Created new package "' . $packageKey . '" at "' . $package->getPackagePath() . '".'); }
/** * Action for creating a new package * * @param string $packageKey The package key of the package to create * @return string */ public function createAction($packageKey) { if ($packageKey === '') { return $this->helpAction(); } if (!$this->packageManager->isPackageKeyValid($packageKey)) { return 'The package key "' . $packageKey . '" is not valid.' . PHP_EOL; } if ($this->packageManager->isPackageAvailable($packageKey)) { return 'The package "' . $packageKey . '" already exists.' . PHP_EOL; } $package = $this->packageManager->createPackage($packageKey); return 'New package "' . $packageKey . '" created at "' . $package->getPackagePath() . '".' . PHP_EOL; }