Skip to content

Commit cc873cc

Browse files
committed
chore(legacy): deprecate OC_Util::runningOnMac()
- Easy enough query directly these days; Only used in one spot anyhow - Updated the runningOnMac method to use PHP_OS_FAMILY just for clarity until we can remove the function entirely (same result; supported since PHP ~7.4). Signed-off-by: Josh <[email protected]>
1 parent 756efb7 commit cc873cc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/private/legacy/OC_Util.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,16 @@ public static function obEnd() {
733733
}
734734

735735
/**
736-
* Checks whether the server is running on Mac OS X
736+
* Checks whether PHP is running directly on macOS.
737+
*
738+
* Note: In a Linux container, this will be false even on a macOS host
739+
* (PHP just sees "Linux").
737740
*
738741
* @return bool true if running on Mac OS X, false otherwise
742+
* @deprecated 33.0.0 Query PHP_OS_FAMILY directly.
739743
*/
740744
public static function runningOnMac() {
741-
return (strtoupper(substr(PHP_OS, 0, 6)) === 'DARWIN');
745+
return (PHP_OS_FAMILY === 'Darwin');
742746
}
743747

744748
/**

0 commit comments

Comments
 (0)