elFinder::chmod PHP Метод

chmod() защищенный Метод

chmod
Автор: David Bartle
protected chmod ( $args ) : array
Результат array
    protected function chmod($args)
    {
        $targets = $args['targets'];
        $mode = intval((string) $args['mode'], 8);
        if (!is_array($targets)) {
            $targets = array($targets);
        }
        $result = array();
        if (($volume = $this->volume($targets[0])) == false) {
            $result['error'] = $this->error(self::ERROR_CONF_NO_VOL);
            return $result;
        }
        $files = array();
        $errors = array();
        foreach ($targets as $target) {
            elFinder::extendTimeLimit();
            $file = $volume->chmod($target, $mode);
            if ($file) {
                $files = array_merge($files, is_array($file) ? $file : array($file));
            } else {
                $errors = array_merge($errors, $volume->error());
            }
        }
        if ($files) {
            $result['changed'] = $files;
            if ($errors) {
                $result['warning'] = $this->error($errors);
            }
        } else {
            $result['error'] = $this->error($errors);
        }
        return $result;
    }