Skip to content

Commit

Permalink
Merge branch 'xdebug_3_3'
Browse files Browse the repository at this point in the history
  • Loading branch information
derickr committed Jul 17, 2024
2 parents 700e605 + 32193fa commit 81a312d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
3 changes: 3 additions & 0 deletions run-xdebug-tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -2000,6 +2000,9 @@ function run_test(string $php, $file, array $env): string

if ($test->sectionNotEmpty('ENV')) {
$env_str = str_replace('{PWD}', dirname($file), $test->getSection('ENV'));
$env_str = str_replace('{RUNID}', getenv('UNIQ_RUN_ID'), $env_str);
$env_str = str_replace('{TEST_PHP_WORKER}', getenv('TEST_PHP_WORKER'), $env_str);
$env_str = str_replace('{TMP}', sys_get_temp_dir(), $env_str);
foreach (explode("\n", $env_str) as $e) {
$e = explode('=', trim($e), 2);

Expand Down
19 changes: 19 additions & 0 deletions tests/debugger/bug02251.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--TEST--
Test for bug #2251: xdebug.log setting not picked up from XDEBUG_CONFIG
--ENV--
XDEBUG_CONFIG=log={TMP}/{RUNID}{TEST_PHP_WORKER}bug02251.log
--INI--
xdebug.mode=debug,develop
default_charset=utf-8
xdebug.filename_format=
xdebug.client_port=9172
xdebug.start_with_request=yes
xdebug.log=
xdebug.log_level=10
--FILE--
<?php
echo file_get_contents(sys_get_temp_dir() . '/' . getenv('UNIQ_RUN_ID') . getenv('TEST_PHP_WORKER') . 'bug02251.log' );
@unlink (sys_get_temp_dir() . '/' . getenv('UNIQ_RUN_ID') . getenv('TEST_PHP_WORKER') . 'bug02251.log' );
?>
--EXPECTF--
%A[Step Debug] %sTried: localhost:9172 (through xdebug.client_host/xdebug.client_port).
10 changes: 5 additions & 5 deletions xdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static void xdebug_env_config(void)
name = "xdebug.cloud_id";
} else
if (strcasecmp(envvar, "idekey") == 0) {
xdebug_debugger_reset_ide_key(envval);
name = "xdebug.idekey";
} else
if (strcasecmp(envvar, "output_dir") == 0) {
name = "xdebug.output_dir";
Expand Down Expand Up @@ -655,6 +655,10 @@ PHP_RINIT_FUNCTION(xdebug)
return SUCCESS;
}

/* Get xdebug ini entries from the environment also,
this can override the idekey if one is set */
xdebug_env_config();

xdebug_library_rinit();

if (XDEBUG_MODE_IS(XDEBUG_MODE_COVERAGE)) {
Expand All @@ -676,10 +680,6 @@ PHP_RINIT_FUNCTION(xdebug)
xdebug_tracing_rinit();
}

/* Get xdebug ini entries from the environment also,
this can override the idekey if one is set */
xdebug_env_config();

xdebug_init_auto_globals();

/* Only enabled extended info when it is not disabled */
Expand Down

0 comments on commit 81a312d

Please sign in to comment.