From 089578a1a608ddb184f304810ef164070dfe81ec Mon Sep 17 00:00:00 2001 From: BasileLT Date: Fri, 19 Apr 2024 13:18:42 +0200 Subject: [PATCH 1/2] Update user_id value in .castor/docker.php for Windows compatibility posix_geteuid -> getmy_uid --- .castor/docker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.castor/docker.php b/.castor/docker.php index 30083ef..e060b79 100644 --- a/.castor/docker.php +++ b/.castor/docker.php @@ -310,7 +310,8 @@ function create_default_context(): Context ], 'macos' => false, 'power_shell' => false, - 'user_id' => posix_geteuid(), + 'user_id' => getmyuid(), // replaced posix_geteuid as posix isn't available in PHP windows + // Windows 11 PHP 8.3.6 'root_dir' => \dirname(__DIR__), ]; From 88871713ac7ae86f591fa41e90d2452200cf8a09 Mon Sep 17 00:00:00 2001 From: BasileLT Date: Fri, 19 Apr 2024 13:58:16 +0200 Subject: [PATCH 2/2] Update user_id value in .castor/docker.php for Windows compatibility Unix system doesn't include getmyuid so a function_exists is used to determine if posix isn't avaible and then fallback to getmyuid --- .castor/docker.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.castor/docker.php b/.castor/docker.php index e060b79..cac9ce0 100644 --- a/.castor/docker.php +++ b/.castor/docker.php @@ -310,8 +310,8 @@ function create_default_context(): Context ], 'macos' => false, 'power_shell' => false, - 'user_id' => getmyuid(), // replaced posix_geteuid as posix isn't available in PHP windows - // Windows 11 PHP 8.3.6 + // check if posix_geteuid is available, if not, use getmyuid (windows) + 'user_id' => function_exists('posix_geteuid') ? posix_geteuid() : getmyuid(), 'root_dir' => \dirname(__DIR__), ];