protected function getMode($path) { $mode = App::trigger(new FileAccessEvent('system.finder'))->mode($path); if ('w' == $mode && !is_writable($path)) { $mode = 'r'; } if ('r' == $mode && !is_readable($path)) { $mode = '-'; } return $mode; }