From 54f27d55349d7cb79d8fb12e9fbb79c160abe7eb Mon Sep 17 00:00:00 2001 From: corpsee Date: Mon, 24 Oct 2016 22:46:40 +0700 Subject: [PATCH] Added debug mode for cron run-builds command --- PHPCI/Command/RunCommand.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/PHPCI/Command/RunCommand.php b/PHPCI/Command/RunCommand.php index c2c352e6..3cd83591 100644 --- a/PHPCI/Command/RunCommand.php +++ b/PHPCI/Command/RunCommand.php @@ -65,7 +65,8 @@ class RunCommand extends Command { $this ->setName('phpci:run-builds') - ->setDescription(Lang::get('run_all_pending')); + ->setDescription(Lang::get('run_all_pending')) + ->addOption('debug', null, null, 'Run PHPCI in Debug Mode'); } /** @@ -83,6 +84,12 @@ class RunCommand extends Command ); } + // Allow PHPCI to run in "debug mode" + if ($input->hasOption('debug') && $input->getOption('debug')) { + $output->writeln('Debug mode enabled.'); + define('PHPCI_DEBUG_MODE', true); + } + $running = $this->validateRunningBuilds(); $this->logger->pushProcessor(new LoggedBuildContextTidier());