cvs: pear /HTML_Template_Flexy Flexy.php package.xml

From: Date: Thu, 06 Feb 2003 07:51:15 +0000
Subject: cvs: pear /HTML_Template_Flexy Flexy.php package.xml
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8730@lists.php.net to get a copy of this message
alan_k Thu Feb 6 02:51:15 2003 EDT Modified files: /pear/HTML_Template_Flexy Flexy.php package.xml Log: update for another release, make the tokenizer the default now. Index: pear/HTML_Template_Flexy/Flexy.php diff -u pear/HTML_Template_Flexy/Flexy.php:1.10 pear/HTML_Template_Flexy/Flexy.php:1.11 --- pear/HTML_Template_Flexy/Flexy.php:1.10 Tue Feb 4 02:11:07 2003 +++ pear/HTML_Template_Flexy/Flexy.php Thu Feb 6 02:51:15 2003 @@ -41,7 +41,7 @@ * - heavily focused on displaying objects as pages. * (so you can document your tags.) * -* @version $Id: Flexy.php,v 1.10 2003/02/04 07:11:07 alan_k Exp $ +* @version $Id: Flexy.php,v 1.11 2003/02/06 07:51:15 alan_k Exp $ */ class HTML_Template_Flexy { @@ -55,7 +55,7 @@ 'filters' => array(), 'debug' => false, 'locale' => 'en', - 'useTokenizer' => false + 'useLegacy' => false ); @@ -100,14 +100,15 @@ * for example the using simpletags the object's variable $t->test * would map to {t.test} * - * maps + * maps ** these are all depreciated and should not be used! + * the area only available if useLegacy is set. * $t->o_* maps to {o.*} // used for output * $t->input maps to {i.*} // used for input * $t->modules[xxxx] maps to {m.xxxx} // used for modules * $t->config maps to {c.*} // used for config * PEAR::getStaticProperty('Auth','singleton') maps to {a.*} * {email_boundary} // for email boundaries - {email_date} // for email dates + * {email_date} // for email dates * * * @version 01/12/14 @@ -125,37 +126,43 @@ echo "output $this->compiledTemplate<BR>"; } - - $m = new StdClass; - // compile modules - - /* these are to be depreciated !!!*/ - - - $c = & $t->config; - if (@$t->input) { - $i = & $t->input; - } - $a = &PEAR::getStaticProperty('Auth','singleton'); - /* expose o_ as $o */ - $o = new StdClass; - foreach (get_object_vars($t) as $k=>$v) { - if ($k{0} != "o") { - continue; + if ($this->options['useLegacy']) { + + $m = new StdClass; + // compile modules + + /* these are to be depreciated !!!*/ + + + $c = & $t->config; + if (@$t->input) { + $i = & $t->input; } - if ($k{1} != "_") { - continue; + $a = &PEAR::getStaticProperty('Auth','singleton'); + + /* expose o_ as $o */ + $o = new StdClass; + foreach (get_object_vars($t) as $k=>$v) { + if ($k{0} != "o") { + continue; + } + if ($k{1} != "_") { + continue; + } + $kk = substr($k,2); + $o->$kk =& $t->$k; } - $kk = substr($k,2); - $o->$kk =& $t->$k; - } - - /* END DEPRECIATED.. depreciated !!!*/ - - /* usefull stuff for doing emails in Template Flexy */ - $email_boundary = md5("FlexyMail".microtime()); - $email_date = date("D j M Y G:i:s O"); + + + /* usefull stuff for doing emails in Template Flexy */ + $email_boundary = md5("FlexyMail".microtime()); + $email_date = date("D j M Y G:i:s O"); + } + // we use PHP's error handler to hide errors in the template. + // this may be removed later, or replace with + // options['strict'] - so you have to declare + // all variables $_error_reporting = false; if (!$options['debug']) { @@ -213,10 +220,11 @@ * @access private * @version 01/12/03 * @author Wolfram Kriesing <wolfram@kriesing.de> + * @author Alan Knowles <alan@akbkhome.com> * @param * @return */ - function classicParse() + function _classicParse() { // read the entire file into one variable if ( $input = @file($this->currentTemplate) ) { @@ -245,7 +253,7 @@ * * @access private * @version 01/12/03 - * @author Alan Knowles <alan@kriesing.de> + * @author Alan Knowles <alan@akbkhome.com> * @param * @return */ @@ -253,7 +261,7 @@ - function parse() + function _parse() { // read the entire file into one variable @@ -389,9 +397,9 @@ $recompile = true; } } - $method = 'classicParse'; - if (@$this->options['useTokenizer']) { - $method = 'parse'; + $method = '_parse'; + if (@$this->options['useLegacy']) { + $method = '_classicParse'; } if( $recompile ) { // or any of the config files if( !$this->$method() ) { Index: pear/HTML_Template_Flexy/package.xml diff -u pear/HTML_Template_Flexy/package.xml:1.12 pear/HTML_Template_Flexy/package.xml:1.13 --- pear/HTML_Template_Flexy/package.xml:1.12 Wed Feb 5 09:35:03 2003 +++ pear/HTML_Template_Flexy/package.xml Thu Feb 6 02:51:15 2003 @@ -32,10 +32,20 @@ <release> <version>0.3</version> - <date>2003-02-14</date> + <date>2003-02-06</date> <notes> Bug fixes - allow usage with only constructor options + - fixed form elements - should be htmlspecialchars, rather than urlencoding + - new Tokenizer is enabled by default - set 'useLegacy' in config/options to + use the old regex replacer. + - no variables are added (eg. o.*, a.* etc. to the page unless useLegacy is set) + - parsers are now private methods. (internal change) + + New Features + - FLEXYSTART and FLEXYSTARTCHILDREN tags added so when use include sub + templates, you can avoid including HEAD etc. tags. + </notes> <state>beta</state> </release>

« previous php.pear.cvs (#8730) next »