andi Sat Sep 22 12:55:35 2001 EDT
Modified files:
/r2/binarycloud/base/utils compiletags.php
Log:
New compiletags script. Works
Index: r2/binarycloud/base/utils/compiletags.php
diff -u r2/binarycloud/base/utils/compiletags.php:1.1 r2/binarycloud/base/utils/compiletags.php:1.2
--- r2/binarycloud/base/utils/compiletags.php:1.1 Fri Sep 21 11:19:02 2001
+++ r2/binarycloud/base/utils/compiletags.php Sat Sep 22 12:55:35 2001
@@ -2,35 +2,66 @@
<?php
// {{{ Header
/*
- * -File $Id: compiletags.php,v 1.1 2001/09/21 18:19:02 andi Exp $
+ * -File $Id: compiletags.php,v 1.2 2001/09/22 19:55:35 andi Exp $
* -License LGPL (http://www.gnu.org/copyleft/lesser.html)
* -Copyright 2001, Intacct Corp.
* -Author odysseas tsatalos, ody...@ya...
* -Author Andris Spruds, an...@do...
- * -Author Andreas Aderhold an...@bi...
+ * -Author Andreas Aderhold, a.a...@th...
*/
// }}}
-// {{{
-$strSyntax = "Usage: $argv[0] buildpath infile outfile\n";
-$argv = $HTTP_SERVER_VARS['argv'];
-if ( sizeof($argv) != 4 ) {
+// main entry point {{{
+
+function main(&$_argv) {
+
+ if ( sizeof($_argv) != 4 ) {
+ _PrintUsage();
+ }
+
+
+ $buildPath=$_argv[1];
+ include_once($buildPath. '/prepend.php');
+
+ $in = realpath($_argv[2]);
+ $out = $_argv[3];
+
+ $Bcc =& _InitBcc();
+ // setup parser and engage
+ $Bcc->Compile($in, $out);
+
+}
+
+// }}}
+// display usage information
+
+function _PrintUsage() {
+ $strSyntax = "Usage: $argv[0] buildpath infile outfile\n";
die($strSyntax);
}
-$buildPath=$argv[1];
-include_once($buildPath. '/prepend.php');
+// }}}
+// Init bcc
-import('binarycloud.lib.XMLUtils');
-import('binarycloud.lib.BCTagParser');
+function &_InitBcc() {
+ import('binarycloud.mod.bcc.Bcc');
-$in = realpath($argv[2]);
-$out = $argv[3];
+ $bcc =& new Bcc;
+ // register and import (internal to bcc) compiler classes
+ $bcc->RegisterTag('BC:MODULE', "BccModuleCompiler");
+ $bcc->RegisterTag('BC:IMG', "BccImgCompiler");
+ return $bcc;
+}
+// }}}
+
+main($HTTP_SERVER_VARS['argv']);
-// setup parser and engage
-$xml =& new BCTagParser($in, $out);
-$xml->RegisterTag('BC:MODULE', "BCCompileModuleTag");
-$xml->RegisterTag('BC:IMG', "BCCompileImgTag");
-$xml->Compile();
// }}} end
+/*
+ * Local Variables:
+ * mode: php
+ * tab-width: 4
+ * c-basic-offset: 4
+ * End:
+ */
?>
|