/**
  * @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
 /**
  * Generate a new migration
  *
  * If $diffAgainstCurrent is TRUE (the default), it generates a migration file
  * with the diff between current DB structure and the found mapping metadata.
  *
  * Otherwise an empty migration skeleton is generated.
  *
  * @param boolean $diffAgainstCurrent Whether to base the migration on the current schema structure
  * @return void
  * @see typo3.flow3:doctrine:migrate
  * @see typo3.flow3:doctrine:migrationstatus
  * @see typo3.flow3:doctrine:migrationexecute
  * @see typo3.flow3:doctrine:migrationversion
  */
 public function migrationGenerateCommand($diffAgainstCurrent = TRUE)
 {
     // "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) {
         $migrationClassPathAndFilename = $this->doctrineService->generateMigration($diffAgainstCurrent);
         $this->outputLine('<u>Generated new migration class!</u>');
         $this->outputLine('');
         $this->outputLine('Next Steps:');
         $this->outputLine(sprintf('- Move <b>%s</b> to YourPackage/<b>Migrations/%s/</b>', $migrationClassPathAndFilename, $this->doctrineService->getDatabasePlatformName()));
         $this->outputLine('- Review and adjust the generated migration.');
         $this->outputLine('- (optional) execute the migration using <b>%s doctrine:migrate</b>', array($this->getFlow3InvocationString()));
     } else {
         $this->outputLine('Doctrine migration generation has been SKIPPED, the driver and host backend options are not set in /Configuration/Settings.yaml.');
         $this->quit(1);
     }
 }