PHPBuilder - Cached Dynamic Modules pt 3 Page 3

RSS Twitter

Cached Dynamic Modules pt 3 - Page 3

by: Travis Swicegood
July 30, 2000


Function variables modified
The parse() and parse_it() functions were changed to the following:

function parse( $doc_root, $file, $_debug = false)
function parse_it( $str, $doc_root, $use_tag, $_debug = false, $def_cache_time = 3600 )
  • $doc_root is the equivalent of PHP's $DOCUMENT_ROOT. There were some problems accessing the global variable, so it was added into the function calls.
  • $_debug has been added to enable/disable debugging mode. By default, debugging mode is turned off.
  • $use_tag in the parse_it() function is the dynamically generated custom tag (example $use_tag = "my" if the file extension is ".my")
  • $def_cache_time in the parse_it() is used to change the default cache time. If it is not set, 3600 seconds (60 minutes) is assumed.
  • $str & $str were respectively carried over from their original purpose with their own functions
Comments revised
The comments within the file parse.php3 have been extensively revised. So much so, that documentation outside the file would be extremely redundant. Also added in the comments section at the bottom of the file are instructions on how to setup parse.php3 to run, as well as example files to test the parser out.

« Previous Page

Comment and Contribute

Your comment has been submitted and is pending approval.

Travis Swicegood



(Maximum characters: 1200). You have characters left.