/**
  * @param string $packageKey
  * @return \TYPO3\FLOW3\Error\Error|\TYPO3\FLOW3\Error\Message
  */
 protected function deactivatePackage($packageKey)
 {
     try {
         $this->packageManager->deactivatePackage($packageKey);
         $this->doctrineService->updateSchema();
         $message = new \TYPO3\FLOW3\Error\Message($packageKey . ' was deactivated', 1343231678);
     } catch (\TYPO3\FLOW3\Package\Exception\ProtectedPackageKeyException $exception) {
         $message = new \TYPO3\FLOW3\Error\Error('The package ' . $packageKey . ' is protected and can not be deactivated', 1343231679);
     }
     return $message;
 }
 /**
  * Action for deactivating a package
  *
  * @param string $packageKey The package key of the package to create
  * @return string
  */
 public function deactivateAction($packageKey)
 {
     if ($packageKey === '') {
         return $this->helpAction();
     }
     if (!$this->packageManager->isPackageActive($packageKey)) {
         return 'Package "' . $packageKey . '" was not active.' . PHP_EOL;
     }
     $this->packageManager->deactivatePackage($packageKey);
     return 'Package "' . $packageKey . '" deactivated.' . PHP_EOL;
 }
 /**
  * Deactivate a package
  *
  * This command deactivates a currently active package.
  *
  * @FLOW3\FlushesCaches
  * @param string $packageKey The package key of the package to create
  * @return string
  * @see typo3.flow3:package:activate
  */
 public function deactivateCommand($packageKey)
 {
     if (!$this->packageManager->isPackageActive($packageKey)) {
         $this->outputLine('Package "%s" was not active.', array($packageKey));
         $this->quit(1);
     }
     $this->packageManager->deactivatePackage($packageKey);
     $this->outputLine('Deactivated package "%s".', array($packageKey));
     Scripts::executeCommand('typo3.flow3:cache:flush', $this->settings, FALSE);
     $this->sendAndExit(0);
 }