Skip to content

Commit

Permalink
posix_geteuid only exists on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Apr 19, 2018
1 parent b8f4b71 commit 2eefef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion framework/caching/FileCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ protected function setValue($key, $value, $duration)
// If ownership differs the touch call will fail, so we try to
// rebuild the file from scratch by deleting it first
// https://github.com/yiisoft/yii2/pull/16120
if (is_file($cacheFile) && fileowner($cacheFile) !== posix_geteuid()) {
if (is_file($cacheFile) && function_exists('posix_geteuid') && fileowner($cacheFile) !== posix_geteuid()) {
@unlink($cacheFile);
}
if (@file_put_contents($cacheFile, $value, LOCK_EX) !== false) {
Expand Down

0 comments on commit 2eefef2

Please sign in to comment.