Disable XDebug in RoboFile, allow it for specific commands
[MAILPOET-1923]
This commit is contained in:
20
RoboFile.php
20
RoboFile.php
@ -6,6 +6,12 @@ class RoboFile extends \Robo\Tasks {
|
||||
use \Codeception\Task\SplitTestsByGroups;
|
||||
|
||||
public function __construct() {
|
||||
|
||||
// disable xdebug to avoid slowing down command execution
|
||||
$xdebug_handler = new \Composer\XdebugHandler\XdebugHandler('mailpoet');
|
||||
$xdebug_handler->setPersistent();
|
||||
$xdebug_handler->check();
|
||||
|
||||
$dotenv = new Dotenv\Dotenv(__DIR__);
|
||||
$dotenv->load();
|
||||
}
|
||||
@ -195,7 +201,8 @@ class RoboFile extends \Robo\Tasks {
|
||||
if ($opts['xml']) {
|
||||
$command .= ' --xml';
|
||||
}
|
||||
return $this->_exec($command);
|
||||
|
||||
return $this->execWithXDebug($command);
|
||||
}
|
||||
|
||||
function testJavascript($xml_output_file = null) {
|
||||
@ -760,4 +767,15 @@ class RoboFile extends \Robo\Tasks {
|
||||
}
|
||||
return $env;
|
||||
}
|
||||
|
||||
private function execWithXDebug($command) {
|
||||
$php_config = new \Composer\XdebugHandler\PhpConfig();
|
||||
$php_config->useOriginal();
|
||||
|
||||
// exec command in subprocess with original settings
|
||||
passthru($command, $exitCode);
|
||||
|
||||
$php_config->usePersistent();
|
||||
return $exitCode;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user