Example #1
0
 public function testGetLog()
 {
     $log = \vc\Provider\Log::getLog();
     $this->assertThat($log, $this->isInstanceOf('\\r8\\Log'));
     $this->assertSame($log, \vc\Provider\Log::getLog());
 }
Example #2
0
 *
 * @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());