protected function attr($path, $name, $val = null)
{
if (!isset($this->defaults[$name])) {
return false;
}
$perm = null;
if ($this->access) {
if (is_array($this->access)) {
$obj = $this->access[0];
$method = $this->access[1];
$perm = $obj->{$method}($name, $path, $this->options['accessControlData'], $this);
} else {
$func = $this->access;
$perm = $func($name, $path, $this->options['accessControlData'], $this);
}
if ($perm !== null) {
return !!$perm;
}
}
if ($this->separator != '/') {
$path = str_replace($this->separator, '/', $this->_relpath($path));
} else {
$path = $this->_relpath($path);
}
$path = '/' . $path;
for ($i = 0, $c = count($this->attributes); $i < $c; $i++) {
$attrs = $this->attributes[$i];
if (isset($attrs[$name]) && isset($attrs['pattern']) && preg_match($attrs['pattern'], $path)) {
$perm = $attrs[$name];
}
}
return $perm === null ? is_null($val) ? $this->defaults[$name] : $val : !!$perm;
}