Exemple #1
0
 public static function enableInstallMode(CommandEvent $event)
 {
     if (!file_exists(SystemUtil::getInstallDoneFilePath())) {
         SystemUtil::enableInstallMode();
     }
     $event->getIO()->write('CampaignChain: Enabled install mode.');
 }
Exemple #2
0
 /**
  * Puts the CampaignChain app into same status as after a fresh
  * <code>
  * composer create-project
  * </code>
  * installation.
  */
 public static function resetApp()
 {
     // Set install mode.
     SystemUtil::enableInstallMode();
     $currentDir = getcwd();
     chdir(self::getRootDir());
     ob_start();
     // Drop all tables
     $command = 'php app/console doctrine:schema:drop --force --full-database';
     system($command, $output);
     // Run composer post install command.
     $command = 'composer run-script post-install-cmd';
     system($command, $output);
     ob_get_clean();
     chdir($currentDir);
 }