Revision: 500
http://rdfapi-php.svn.sourceforge.net/rdfapi-php/?rev=500&view=rev
Author: cweiske
Date: 2007-08-12 23:14:37 -0700 (Sun, 12 Aug 2007)
Log Message:
-----------
Add debug option
Modified Paths:
--------------
trunk/rdfapi-php/test/parseN3.php
Modified: trunk/rdfapi-php/test/parseN3.php
===================================================================
--- trunk/rdfapi-php/test/parseN3.php 2007-08-13 06:06:02 UTC (rev 499)
+++ trunk/rdfapi-php/test/parseN3.php 2007-08-13 06:14:37 UTC (rev 500)
@@ -8,17 +8,24 @@
if ($argc <= 1) {
echo <<<EOT
Parses an N3 ("turtle") file
- Usage: php parseN3.php /path/to/file.n3
+ Usage: php parseN3.php [--debug] /path/to/file.n3
EOT;
exit(1);
}
+if ($argc == 3 && $argv[1] == '--debug') {
+ $bDebug = true;
+ array_shift($argv);
+} else {
+ $bDebug = false;
+}
+
$file = $argv[1];
if (!file_exists($file)) {
echo <<<EOT
File does not exist.
- Usage: php parseN3.php /path/to/file.n3
+ Usage: php parseN3.php [--debug] /path/to/file.n3
EOT;
exit(2);
@@ -29,6 +36,9 @@
require_once RDFAPI_INCLUDE_DIR . 'syntax/N3Parser.php';
$parser = new N3Parser();
+if ($bDebug) {
+ $parser->debug = true;
+}
$parser->parse(
file_get_contents($file)
);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|