Skip to content

Commit 6511ed6

Browse files
ci(e2e): add debug logging to router.php to diagnose path issues
Log REQUEST_URI, URI, and dispatch info to stderr to understand why paths are being duplicated or misrouted in CI environment. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 56191a2 commit 6511ed6

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

playwright/router.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@
1616
$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
1717
$file = $rootDir . $uri;
1818

19+
// Debug: log all requests (to stderr so it shows in PHP output)
20+
error_log(sprintf(
21+
'[ROUTER] REQUEST_URI=%s | URI=%s | SCRIPT_NAME=%s | file_exists=%d',
22+
$_SERVER['REQUEST_URI'],
23+
$uri,
24+
$_SERVER['SCRIPT_NAME'] ?? 'N/A',
25+
file_exists($file) ? 1 : 0
26+
));
27+
1928
// Serve static files as-is (except PHP files)
2029
if ($uri !== '/' && file_exists($file) && !is_dir($file) && pathinfo($uri, PATHINFO_EXTENSION) !== 'php') {
2130
return false;
@@ -26,6 +35,12 @@
2635
$_SERVER['SCRIPT_FILENAME'] = $rootDir . $script;
2736
$_SERVER['PHP_SELF'] = $script;
2837
$_SERVER['PATH_INFO'] = substr($uri, strlen($script)) ?: '';
38+
error_log(sprintf(
39+
'[ROUTER DISPATCH] SCRIPT=%s | PATH_INFO=%s | SCRIPT_FILENAME=%s',
40+
$script,
41+
$_SERVER['PATH_INFO'] ?? 'empty',
42+
$_SERVER['SCRIPT_FILENAME']
43+
));
2944
require $rootDir . $script;
3045
};
3146

0 commit comments

Comments
 (0)