Skip to content

Commit bfee9dc

Browse files
committed
Allow running Tinker commands on Lambda
1 parent be9daa4 commit bfee9dc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/StorageDirectories.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public static function create()
2626
self::Path . '/bootstrap/cache',
2727
self::Path . '/framework/cache',
2828
self::Path . '/framework/views',
29+
self::Path . '/psysh',
2930
];
3031

3132
$directories = array_filter($directories, static fn ($directory) => ! is_dir($directory));

src/bref-init.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515

1616
MaintenanceMode::setUp();
1717

18+
// Move the location of the PsySH config cache to `/tmp` (because it is writable)
19+
$xdgHome = StorageDirectories::Path . '/psysh';
20+
$_SERVER['XDG_CONFIG_HOME'] = $_ENV['XDG_CONFIG_HOME'] = $xdgHome;
21+
putenv("XDG_CONFIG_HOME=$xdgHome");
22+
1823
$defaultConfigCachePath = $_SERVER['LAMBDA_TASK_ROOT'] . '/bootstrap/cache/config.php';
1924

2025
if (file_exists($defaultConfigCachePath)) {

0 commit comments

Comments
 (0)