Ejemplo n.º 1
0
 /**
  * Action for deleting an existing package
  *
  * @param string $packageKey The package key of the package to create
  * @return string
  */
 public function deleteAction($packageKey)
 {
     if ($packageKey === '') {
         return $this->helpAction();
     }
     if (!$this->packageManager->isPackageAvailable($packageKey)) {
         return 'The package "' . $packageKey . '" does not exist.' . PHP_EOL;
     }
     $this->packageManager->deletePackage($packageKey);
     return 'Package "' . $packageKey . '" has been deleted.' . PHP_EOL;
 }
Ejemplo n.º 2
0
 /**
  * Delete an existing package
  *
  * This command deletes an existing package identified by the package key.
  *
  * @FLOW3\FlushesCaches
  * @param string $packageKey The package key of the package to create
  * @return string
  */
 public function deleteCommand($packageKey)
 {
     if (!$this->packageManager->isPackageAvailable($packageKey)) {
         $this->outputLine('The package "%s" does not exist.', array($packageKey));
         $this->quit(1);
     }
     $this->packageManager->deletePackage($packageKey);
     $this->outputLine('Deleted package "%s".', array($packageKey));
     Scripts::executeCommand('typo3.flow3:cache:flush', $this->settings, FALSE);
     $this->sendAndExit(0);
 }
Ejemplo n.º 3
0
 /**
  * @param string $packageKey
  * @return \TYPO3\FLOW3\Error\Error|\TYPO3\FLOW3\Error\Message
  */
 protected function deletePackage($packageKey)
 {
     try {
         $this->packageManager->deletePackage($packageKey);
         $message = new \TYPO3\FLOW3\Error\Message($packageKey . ' has been deleted', 1343231685);
     } catch (\TYPO3\FLOW3\Package\Exception\UnknownPackageException $exception) {
         $message = new \TYPO3\FLOW3\Error\Error($exception->getMessage(), 1343231686);
     } catch (\TYPO3\FLOW3\Package\Exception\ProtectedPackageKeyException $exception) {
         $message = new \TYPO3\FLOW3\Error\Error($exception->getMessage(), 1343231687);
     } catch (\TYPO3\FLOW3\Package\Exception $exception) {
         $message = new \TYPO3\FLOW3\Error\Error($exception->getMessage(), 1343231688);
     }
     return $message;
 }