/**
  * @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;
 }
Esempio n. 2
0
 /**
  * Update the database schema
  *
  * Updates the database schema without using existing migrations.
  *
  * It will not drop foreign keys, sequences and tables, unless <u>--unsafe-mode</u> is set.
  *
  * @param boolean $unsafeMode If set, foreign keys, sequences and tables can potentially be dropped.
  * @param string $output A file to write SQL to, instead of executing the update directly
  * @return void
  * @see typo3.flow3:doctrine:create
  * @see typo3.flow3:doctrine:migrate
  */
 public function updateCommand($unsafeMode = FALSE, $output = NULL)
 {
     // "driver" is used only for Doctrine, thus we (mis-)use it here
     // additionally, when no path is set, skip this step, assuming no DB is needed
     if ($this->settings['backendOptions']['driver'] !== NULL && $this->settings['backendOptions']['host'] !== NULL) {
         $this->doctrineService->updateSchema(!$unsafeMode, $output);
         if ($output === NULL) {
             $this->outputLine('Executed a database schema update.');
         } else {
             $this->outputLine('Wrote schema update SQL to file "' . $output . '".');
         }
     } else {
         $this->outputLine('Database schema update has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.');
         $this->quit(1);
     }
 }