1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
<?php namespace amekusa\phio; main::required;
class Perms {
protected
$mode;
public function __construct($Mode = 0777) {
$this->mode = is_int($Mode) ? $Mode : octdec((string) $Mode);
}
public function isOwnerReadable() {
return $this->getMode() & 0x0100;
}
public function isOwnerWritable() {
return $this->getMode() & 0x0080;
}
public function isOwnerExecutable() {
return $this->getMode() & 0x0040;
}
public function isGroupReadable() {
return $this->getMode() & 0x0020;
}
public function isGroupWritable() {
return $this->getMode() & 0x0010;
}
public function isGroupExecutable() {
return $this->getMode() & 0x0008;
}
public function isUserReadable() {
return $this->getMode() & 0x0004;
}
public function isUserWritable() {
return $this->getMode() & 0x0002;
}
public function isUserExecutable() {
return $this->getMode() & 0x0001;
}
public function getMode() {
return $this->mode;
}
public function setMode($Mode) {
$this->mode = $Mode;
return $this;
}
}