src/Path.php
public static function compileMode(array $perms)
    {
        $fmode = 0;
        $fmode |= !empty($perms['owner']['read'])    ? self::OWNER_READ    : 0;
        $fmode |= !empty($perms['owner']['write'])   ? self::OWNER_WRITE   : 0;
        $fmode |= !empty($perms['owner']['execute']) ? self::OWNER_EXECUTE : 0;

        $fmode |= !empty($perms['group']['read'])    ? self::GROUP_READ    : 0;
        $fmode |= !empty($perms['group']['write'])   ? self::GROUP_WRITE   : 0;
        $fmode |= !empty($perms['group']['execute']) ? self::GROUP_EXECUTE : 0;

        $fmode |= !empty($perms['world']['read'])    ? self::WORLD_READ    : 0;
        $fmode |= !empty($perms['world']['write'])   ? self::WORLD_WRITE   : 0;
        $fmode |= !empty($perms['world']['execute']) ? self::WORLD_EXECUTE : 0;

        return $fmode;
    }
public static function compileMode(array $perms)
    {
        $fmode = 0;
        $fmode |= !empty($perms['owner']['read'])    ? self::OWNER_READ    : 0;
        $fmode |= !empty($perms['owner']['write'])   ? self::OWNER_WRITE   : 0;
        $fmode |= !empty($perms['owner']['execute']) ? self::OWNER_EXECUTE : 0;

        $fmode |= !empty($perms['group']['read'])    ? self::GROUP_READ    : 0;
        $fmode |= !empty($perms['group']['write'])   ? self::GROUP_WRITE   : 0;
        $fmode |= !empty($perms['group']['execute']) ? self::GROUP_EXECUTE : 0;

        $fmode |= !empty($perms['world']['read'])    ? self::WORLD_READ    : 0;
        $fmode |= !empty($perms['world']['write'])   ? self::WORLD_WRITE   : 0;
        $fmode |= !empty($perms['world']['execute']) ? self::WORLD_EXECUTE : 0;

        return $fmode;
    }
public static function compileMode ( array $ perms ) { $ fmode = 0 ; $ fmode |= ! empty ( $ perms [ 'owner' ] [ 'read' ] ) ? self :: OWNER_READ : 0 ; $ fmode |= ! empty ( $ perms [ 'owner' ] [ 'write' ] ) ? self :: OWNER_WRITE : 0 ; $ fmode |= ! empty ( $ perms [ 'owner' ] [ 'execute' ] ) ? self :: OWNER_EXECUTE : 0 ; $ fmode |= ! empty ( $ perms [ 'group' ] [ 'read' ] ) ? self :: GROUP_READ : 0 ; $ fmode |= ! empty ( $ perms [ 'group' ] [ 'write' ] ) ? self :: GROUP_WRITE : 0 ; $ fmode |= ! empty ( $ perms [ 'group' ] [ 'execute' ] ) ? self :: GROUP_EXECUTE : 0 ; $ fmode |= ! empty ( $ perms [ 'world' ] [ 'read' ] ) ? self :: WORLD_READ : 0 ; $ fmode |= ! empty ( $ perms [ 'world' ] [ 'write' ] ) ? self :: WORLD_WRITE : 0 ; $ fmode |= ! empty ( $ perms [ 'world' ] [ 'execute' ] ) ? self :: WORLD_EXECUTE : 0 ; return $ fmode ; }
Create a file mode from an array containing permissions. The array
can have 'owner', 'group' and 'world' members, each which can have
'read', 'write', and 'execute' booleans that indicate whether that
permission is present or not.
Create a file mode from an array containing permissions . The array can have owner group and world members each which can have read write and execute booleans that indicate whether that permission is present or not .