elFinder\elFinder::get PHP 메소드

get() 보호된 메소드

Return file content
저자: Dmitry (dio) Levashov
protected get ( array $args ) : array
$args array command arguments
리턴 array
    protected function get($args)
    {
        $target = $args['target'];
        $volume = $this->volume($target);
        if (!$volume || ($file = $volume->file($target)) == false) {
            return array('error' => $this->error(self::ERROR_OPEN, '#' . $target, self::ERROR_FILE_NOT_FOUND));
        }
        if (($content = $volume->getContents($target)) === false) {
            return array('error' => $this->error(self::ERROR_OPEN, $volume->path($target), $volume->error()));
        }
        $json = json_encode($content);
        if ($json == 'null' && strlen($json) < strlen($content)) {
            return array('error' => $this->error(self::ERROR_NOT_UTF8_CONTENT, $volume->path($target)));
        }
        return array('content' => $content);
    }