コード例 #1
0
ファイル: ScriptHandler.php プロジェクト: CampaignChain/core
 public static function enableInstallMode(CommandEvent $event)
 {
     if (!file_exists(SystemUtil::getInstallDoneFilePath())) {
         SystemUtil::enableInstallMode();
     }
     $event->getIO()->write('CampaignChain: Enabled install mode.');
 }
コード例 #2
0
ファイル: SystemUtil.php プロジェクト: CampaignChain/core
 /**
  * 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);
 }