Skip to content

Commit d22a7db

Browse files
authored
Merge pull request #225 from php-school/disable-xdebug-when-executing-programs
Disable Xdebug when executing programs
2 parents f889737 + 73d1cef commit d22a7db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ExerciseRunner/CgiRunner.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ private function getProcess(string $fileName, RequestInterface $request): Proces
217217
'SCRIPT_FILENAME' => $fileName,
218218
'REDIRECT_STATUS' => 302,
219219
'QUERY_STRING' => $request->getUri()->getQuery(),
220-
'REQUEST_URI' => $request->getUri()->getPath()
220+
'REQUEST_URI' => $request->getUri()->getPath(),
221+
'XDEBUG_MODE' => 'off',
221222
];
222223

223224
$cgi = sprintf('php-cgi%s', DIRECTORY_SEPARATOR === '\\' ? '.exe' : '');

src/ExerciseRunner/CliRunner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function getPhpProcess(string $fileName, ArrayObject $args): Process
120120
return new Process(
121121
$args->prepend($fileName)->prepend(PHP_BINARY)->getArrayCopy(),
122122
dirname($fileName),
123-
null,
123+
['XDEBUG_MODE' => 'off'],
124124
null,
125125
10
126126
);

0 commit comments

Comments
 (0)