public function mode($path)
{
if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
$path = strtr($path, '\\', '/');
}
foreach ($this->notPaths as $regex) {
if (preg_match($regex, $path)) {
return '-';
}
}
foreach ($this->writePaths as $regex) {
if (preg_match($regex, $path)) {
return 'w';
}
}
foreach ($this->readPaths as $regex) {
if (preg_match($regex, $path)) {
return 'r';
}
}
return '-';
}