/** * Constructor... * * @param \r8\FileSys\File $file The file being opened */ public function __construct(\r8\FileSys\File $file) { $file->requirePath(); if (!$file->isReadable()) { throw new \r8\Exception\FileSystem\Permissions($file->getPath(), "File is not readable"); } parent::__construct($file->getPath()); }
/** * Parses the given token reader * * @param \r8\FileSys\File $path The file to parse * @return \vc\Data\File */ public function parse(\r8\FileSys\File $path) { $file = new \vc\Data\File($path->getPath()); $tokens = \vc\Tokens\Access::buildAccess(new \vc\Tokens\Parser(new \r8\Stream\In\File($path))); $this->comment->parse($file, $tokens); return $file; }
/** * Returns whether this file is actually an uploaded file * * @return Boolean */ public function isUploadedFile() { return \is_uploaded_file($this->file->getPath()); }
/** * Logs that a file could not be parsed * * @param \r8\FileSys\File $file The file that was parsed * @param \vc\Tokens\Exception $err The error that occurred * @return NULL */ public function errorParsingFile(\r8\FileSys\File $file, \vc\Tokens\Exception $err) { $this->log->warning(sprintf('Unable to parse file (%s) becase of error: %s', $file->getPath(), $err->getMessage()), 'PARSE_ERR'); }