Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Commit

Permalink
Move xdebug/phpdbg warning to where actually needed
Browse files Browse the repository at this point in the history
Move the coverage driver check from the bootstrap to the execution. Fixes #203.
  • Loading branch information
padraic authored and theofidry committed May 15, 2017
1 parent 7b9dcd6 commit 3fab427
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
fwrite(STDERR, 'You need to run "composer.phar install" to install Humbug.' . PHP_EOL);
exit(1);
}
if (PHP_SAPI !== 'phpdbg' && !defined('HHVM_VERSION') && !extension_loaded('xdebug')) {
fwrite(STDERR, 'You need to install and enable xdebug in order to allow for code coverage generation.' . PHP_EOL);
exit(1);
}

require_once HUMBUG_COMPOSER_INSTALL;

Expand Down
8 changes: 8 additions & 0 deletions src/Command/Humbug.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ class Humbug extends Command
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if (PHP_SAPI !== 'phpdbg' && !defined('HHVM_VERSION') && !extension_loaded('xdebug')) {
$output->writeln(
'<error>You need to install and enable xdebug, or use phpdbg, '
. 'in order to allow for code coverage generation.</error>'
);
return 1;
}

Performance::upMemProfiler();

$this->validate($input);
Expand Down

0 comments on commit 3fab427

Please sign in to comment.