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);
}