File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -254,11 +254,38 @@ public function operatingSystem(): OperatingSystem
254254
255255 public function operatingSystemFamily (): OperatingSystemFamily
256256 {
257+ /** @link https://github.com/sebastianbergmann/environment/commit/eb6dd721cfaca04c27ac61c7201493a8f62f7f1d */
257258 $ osFamily = OperatingSystemFamily::tryFrom (strtolower (trim (
258259 self ::cleanWarningAndDeprecationsFromOutput (Process::run ([
259260 $ this ->phpBinaryPath ,
260261 '-r ' ,
261- 'echo PHP_OS_FAMILY; ' ,
262+ <<<'PHP'
263+ if (defined('PHP_OS_FAMILY')) {
264+ echo PHP_OS_FAMILY;
265+ } elseif ('\\' === DIRECTORY_SEPARATOR) {
266+ echo 'Windows';
267+ } else {
268+ switch(PHP_OS) {
269+ case 'Darwin':
270+ echo 'Darwin';
271+ break;
272+ case 'DragonFly':
273+ case 'FreeBSD':
274+ case 'NetBSD':
275+ case 'OpenBSD':
276+ echo 'BSD';
277+ break;
278+ case 'Linux':
279+ echo 'Linux';
280+ break;
281+ case 'SunOS':
282+ echo 'Solaris';
283+ break;
284+ default:
285+ echo 'Unknown';
286+ }
287+ }
288+ PHP,
262289 ])),
263290 )));
264291 Assert::notNull ($ osFamily , 'Could not determine operating system family ' );
You can’t perform that action at this time.
0 commit comments