rfc:enumset
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
rfc:enumset [2021/03/14 08:12] – example added bwoebi | rfc:enumset [2021/03/14 08:16] – bwoebi | ||
---|---|---|---|
Line 179: | Line 179: | ||
case OWNER_EXEC = 0100; case OWNER_WRITE = 0200; case OWNER_READ = 0400; | case OWNER_EXEC = 0100; case OWNER_WRITE = 0200; case OWNER_READ = 0400; | ||
| | ||
- | static function toInt(EnumSet< | + | static function toInt(EnumSet< |
$bits = 0; | $bits = 0; | ||
foreach ($perms as $perm) { | foreach ($perms as $perm) { | ||
Line 187: | Line 187: | ||
} | } | ||
| | ||
- | static function fromInt(int $bits) { | + | static function fromInt(int $bits) |
$perms = new EnumSet< | $perms = new EnumSet< | ||
foreach (self:: | foreach (self:: | ||
Line 201: | Line 201: | ||
$perms = FilePerm:: | $perms = FilePerm:: | ||
- | $perms &= OWNER_READ | OWNER_WRITE | OWNER_EXEC; // dismiss all but owner permissions | + | $perms & |
chmod($someFile, | chmod($someFile, |
rfc/enumset.txt · Last modified: 2021/03/14 13:37 by bwoebi