Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/private/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,11 @@ public function getSystemInfo(bool $allowAllDatabases = false): array {
}
}

if (\OC_Util::runningOnMac()) {
// Check if running directly on macOS (note: Linux containers on macOS will not trigger this)
if (PHP_OS_FAMILY === 'Darwin') {
$errors[] = [
'error' => $this->l10n->t(
'Mac OS X is not supported and %s will not work properly on this platform. '
'macOS is not supported and %s will not work properly on this platform. '
. 'Use it at your own risk!',
[$this->defaults->getProductName()]
),
Expand Down
8 changes: 6 additions & 2 deletions lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -733,12 +733,16 @@ public static function obEnd() {
}

/**
* Checks whether the server is running on Mac OS X
* Checks whether PHP is running directly on macOS.
*
* Note: In a Linux container, this will be false even on a macOS host
* (PHP just sees "Linux").
*
* @return bool true if running on Mac OS X, false otherwise
* @deprecated 33.0.0 Query PHP_OS_FAMILY directly.
*/
public static function runningOnMac() {
return (strtoupper(substr(PHP_OS, 0, 6)) === 'DARWIN');
return (PHP_OS_FAMILY === 'Darwin');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/Files/ViewTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ public function xtestLongPath() {
*/
$folderName = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789';
$tmpdirLength = strlen(Server::get(ITempManager::class)->getTemporaryFolder());
if (\OC_Util::runningOnMac()) {
if (PHP_OS_FAMILY === 'Darwin') { // macOS
$depth = ((1024 - $tmpdirLength) / 57);
} else {
$depth = ((4000 - $tmpdirLength) / 57);
Expand Down
Loading