From: andi <bin...@li...> - 2001-10-02 17:39:19
|
andi Tue Oct 2 10:39:13 2001 EDT Modified files: /r2/binarycloud/base/mod/bcc Bcc.php Log: Changed standard behaviour if outfile is missing. Now writes to the same file if outfile is not provided to Compile() Index: r2/binarycloud/base/mod/bcc/Bcc.php diff -u r2/binarycloud/base/mod/bcc/Bcc.php:1.1 r2/binarycloud/base/mod/bcc/Bcc.php:1.2 --- r2/binarycloud/base/mod/bcc/Bcc.php:1.1 Sat Sep 22 12:58:15 2001 +++ r2/binarycloud/base/mod/bcc/Bcc.php Tue Oct 2 10:39:13 2001 @@ -1,7 +1,7 @@ <?php // Header {{{ /* - * -File $Id: Bcc.php,v 1.1 2001/09/22 19:58:15 andi Exp $ + * -File $Id: Bcc.php,v 1.2 2001/10/02 17:39:13 andi Exp $ * -License LGPL (http://www.gnu.org/copyleft/lesser.html) * -Copyright 2001, Andreas Aderhold * -Authors Andreas Aderhold, <an...@bi...> @@ -27,8 +27,20 @@ * import('binarycloud.mod.bcc.BccInit'); * $Bcc->Compile('source.thtml','destination.html'); * + * TODO: - setup some rules for output filenames so that + * only infile is required and other xml files are + * recognized automatically (config, rules, query, etc) + * - accept list of files or config file with list of files + * - set up global parser or in this class so that Modules + * don't have to setup/destroy a parser on every tag + * Maybe the Bcc*Compiler have to extent this class or + * make BCC global, have to think about it. + * + * + * + * * @author Andreas Aderhold, a.a...@th... - * @version $Id: Bcc.php,v 1.1 2001/09/22 19:58:15 andi Exp $ + * @version $Id: Bcc.php,v 1.2 2001/10/02 17:39:13 andi Exp $ */ class Bcc { @@ -46,6 +58,10 @@ var $infile = null; var $outfile = null; + /** contains a xml parser object that can be used */ + var $xmlParser = 0; + + // Bcc() {{{ /** * Constructor. Imports default compiler if wanted @@ -70,9 +86,15 @@ * @author Andreas Aderhold, <a.a...@th...> */ - function Compile($_infile, $_outfile = 'stdout') { + function Compile($_infile, $_outfile = null) { $this->infile = $_infile; - $this->outfile = $_outfile; + + if (!$_outfile) { + $this->outfile = $_infile; + } else { + $this->outfile = $_outfile; + } + $success = $this->_CompileFile(); return $success; } @@ -149,7 +171,7 @@ } } - echo "Compiling tags...\n"; + printf("Compiling %s...\n", $this->infile); /* found at least one block, loop through and call compiler */ for ($i = 0; $i < count($tagData); $i++) { |