lib/Finder.php
private function checkFilePermissions(\SplFileInfo $fileInfo): bool {
    // Others.
    $perms = $fileInfo->getPerms();
    if ($perms & 0001) return true;

    // Group.
    $gid = function_exists('posix_getgid') ? posix_getgid() : -1;
    if ($perms & 0010) return $gid == $fileInfo->getGroup();

    // Owner.
    $uid = function_exists('posix_getuid') ? posix_getuid() : -1;
    if ($perms & 0100) return $uid == $fileInfo->getOwner();

    // Root.
    return $perms & (0100 | 0010) ? $uid == 0 : false;
  }
private function checkFilePermissions(\SplFileInfo $fileInfo): bool {
    // Others.
    $perms = $fileInfo->getPerms();
    if ($perms & 0001) return true;

    // Group.
    $gid = function_exists('posix_getgid') ? posix_getgid() : -1;
    if ($perms & 0010) return $gid == $fileInfo->getGroup();

    // Owner.
    $uid = function_exists('posix_getuid') ? posix_getuid() : -1;
    if ($perms & 0100) return $uid == $fileInfo->getOwner();

    // Root.
    return $perms & (0100 | 0010) ? $uid == 0 : false;
  }
private function checkFilePermissions ( \ SplFileInfo $ fileInfo ) : bool { // Others. $ perms = $ fileInfo -> getPerms ( ) ; if ( $ perms & 0001 ) return true ; // Group. $ gid = function_exists ( 'posix_getgid' ) ? posix_getgid ( ) : - 1 ; if ( $ perms & 0010 ) return $ gid == $ fileInfo -> getGroup ( ) ; // Owner. $ uid = function_exists ( 'posix_getuid' ) ? posix_getuid ( ) : - 1 ; if ( $ perms & 0100 ) return $ uid == $ fileInfo -> getOwner ( ) ; // Root. return $ perms & ( 0100 | 0010 ) ? $ uid == 0 : false ; }
Checks that the specified file is executable according to its permissions.
@param \SplFileInfo $fileInfo The file to be checked.
@return bool Value indicating whether the specified file is executable.
Checks that the specified file is executable according to its permissions .