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:
@@ -893,7 +893,7 @@ class GameResponseService
|
||||
return $this->readVerificationFile($player, $file);
|
||||
}
|
||||
|
||||
$physicalPath = 'assets/game1/filesystem' . $file;
|
||||
$physicalPath = $this->projectDir . '/assets/game1/filesystem' . $file;
|
||||
if (!file_exists($physicalPath)) {
|
||||
return ['File does not exist'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user