/** * Parses the given file * * @return \vc\Data\File */ public function parseFile($path) { return \vc\Provider\Parser::getFileParser()->parse(new \r8\FileSys\File($path)); }
public function testGetFileParser() { $parser = \vc\Provider\Parser::getFileParser(); $this->assertThat($parser, $this->isInstanceOf('\\vc\\Parser\\File\\Path')); }
* * @author James Frasca <*****@*****.**> * @copyright Copyright 2009, James Frasca, All Rights Reserved */ // Set up the environment require_once __DIR__ . '/include.php'; // Get the command line argument parser $cliParser = \vc\Provider\CLI::getArgParser(); // Attempt to parse the input arguments try { $result = $cliParser->process(); } catch (\r8\Exception\Data $err) { echo "Error!\n" . $err->getMessage() . "\n" . "For details about using this command, use the '--help' option\n\n"; exit; } // If they requested version... if ($result->flagExists('v')) { echo "PHP Vocab, version " . VOCAB_VERSION . " - http://vocab.roundeights.com\n" . "Round Eights, version " . r8_VERSION . " - http://www.roundeights.com\n\n"; exit; } else { if ($result->flagExists('h') || $result->countArgs() == 0) { echo $cliParser->getHelp(); exit; } } $config = \r8(new \vc\App\Builder())->build($result); $parser = \vc\Provider\Parser::getFileParser(); $logger = \vc\Provider\Log::getParseLogger(); $storage = new \vc\Storage\Memory(); $scanner = new \vc\App\Scanner($logger, $parser, $storage); $scanner->scan($config->getInputPaths());