Fix cat command using relative path for physical file lookup

getFileContent() built the game1 filesystem path as a relative
string with no leading slash. That only resolves correctly when
PHP's cwd happens to be the project root (e.g. CLI), but under
PHP-FPM/nginx the cwd is nginx's document root (public/), so
file_exists() always failed for real requests even though the file
existed and the in-memory virtual file list (used by ls) said it
should. Use the already-injected $projectDir (%kernel.project_dir%),
matching how the class already builds the session log path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Frank
2026-07-04 18:12:55 +02:00
co-authored by Claude Sonnet 5
parent 3721abcc5d
commit ddd2726687
+1 -1
View File
@@ -893,7 +893,7 @@ class GameResponseService
return $this->readVerificationFile($player, $file); return $this->readVerificationFile($player, $file);
} }
$physicalPath = 'assets/game1/filesystem' . $file; $physicalPath = $this->projectDir . '/assets/game1/filesystem' . $file;
if (!file_exists($physicalPath)) { if (!file_exists($physicalPath)) {
return ['File does not exist']; return ['File does not exist'];
} }