diff --git a/src/StorageDirectories.php b/src/StorageDirectories.php index 4df6d58..753cc38 100644 --- a/src/StorageDirectories.php +++ b/src/StorageDirectories.php @@ -26,6 +26,7 @@ public static function create() self::Path . '/bootstrap/cache', self::Path . '/framework/cache', self::Path . '/framework/views', + self::Path . '/psysh', ]; $directories = array_filter($directories, static fn ($directory) => ! is_dir($directory)); diff --git a/src/bref-init.php b/src/bref-init.php index 173a467..5a87031 100644 --- a/src/bref-init.php +++ b/src/bref-init.php @@ -15,6 +15,11 @@ MaintenanceMode::setUp(); + // Move the location of the PsySH config cache to `/tmp` (because it is writable) + $xdgHome = StorageDirectories::Path . '/psysh'; + $_SERVER['XDG_CONFIG_HOME'] = $_ENV['XDG_CONFIG_HOME'] = $xdgHome; + putenv("XDG_CONFIG_HOME=$xdgHome"); + $defaultConfigCachePath = $_SERVER['LAMBDA_TASK_ROOT'] . '/bootstrap/cache/config.php'; if (file_exists($defaultConfigCachePath)) {