cvs: pear /HTML_Template_Xipe Xipe.php /HTML_Template_Xipe/Xipe Main.php

From: Date: Fri, 10 Jan 2003 19:06:41 +0000
Subject: cvs: pear /HTML_Template_Xipe Xipe.php /HTML_Template_Xipe/Xipe Main.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-8175@lists.php.net to get a copy of this message
cain Fri Jan 10 14:06:41 2003 EDT Modified files: /pear/HTML_Template_Xipe Xipe.php /pear/HTML_Template_Xipe/Xipe Main.php Log: - added method 'compiled()' Index: pear/HTML_Template_Xipe/Xipe.php diff -u pear/HTML_Template_Xipe/Xipe.php:1.22 pear/HTML_Template_Xipe/Xipe.php:1.23 --- pear/HTML_Template_Xipe/Xipe.php:1.22 Fri Jan 10 08:23:33 2003 +++ pear/HTML_Template_Xipe/Xipe.php Fri Jan 10 14:06:40 2003 @@ -16,7 +16,7 @@ // | Authors: Wolfram Kriesing <wolfram@kriesing.de> | // +----------------------------------------------------------------------+ // -// $Id: Xipe.php,v 1.22 2003/01/10 13:23:33 cain Exp $ +// $Id: Xipe.php,v 1.23 2003/01/10 19:06:40 cain Exp $ // /** @@ -181,6 +181,24 @@ // this doesnt work with caching, so use getCompiledTemplate() !!! $this->compiledTemplate = $this->getCompiledTemplate(); return $ret; + } + + /** + * tells if the current template needed to be compiled + * if 'compile()' was called before and the template didnt + * need to be recompiled this method will return false too + * + * @see compile() + * @access private + * @version 2003/01/10 + * @author Wolfram Kriesing <wolfram@kriesing.de> + * @return boolean if the template was compiled + */ + function compiled( $file=null ) + { + if( $file ) + return $this->_methodWrapper( $file , 'compiled' ); + return $this->_objectPool[$this->_lastUsedObjectKey]->compiled(); } /** Index: pear/HTML_Template_Xipe/Xipe/Main.php diff -u pear/HTML_Template_Xipe/Xipe/Main.php:1.11 pear/HTML_Template_Xipe/Xipe/Main.php:1.12 --- pear/HTML_Template_Xipe/Xipe/Main.php:1.11 Fri Jan 10 08:23:34 2003 +++ pear/HTML_Template_Xipe/Xipe/Main.php Fri Jan 10 14:06:41 2003 @@ -15,7 +15,7 @@ // +----------------------------------------------------------------------+ // | Authors: Wolfram Kriesing <wolfram@kriesing.de> | // +----------------------------------------------------------------------+ -// $Id: Main.php,v 1.11 2003/01/10 13:23:34 cain Exp $ +// $Id: Main.php,v 1.12 2003/01/10 19:06:41 cain Exp $ // require_once 'PEAR.php'; @@ -146,6 +146,12 @@ * @var float the time compiling/delivering took */ var $_compileTime = 0; + + /** + * @var boolean if the template was compiled + * @see compiled(), compile() + */ + var $_compiled = false; /** * the constructor, pass the options to it as needed @@ -424,6 +430,7 @@ $startTime = split(" ",microtime()); $startTime = $startTime[1]+$startTime[0]; + $this->_compiled = false; if( $this->_needsRecompile() ) { $this->_log( 'compile started' ); @@ -437,9 +444,27 @@ $endTime = $endTime[1]+$endTime[0]; $itTook = ($endTime - $startTime)*100; $this->_log("(compilation and) deliverance took: $itTook ms" ); + + $this->_compiled = true; } return true; + } + + /** + * tells if the current template needed to be compiled + * if 'compile()' was called before and the template didnt + * need to be recompiled this method will return false too + * + * @see compile() + * @access private + * @version 2003/01/10 + * @author Wolfram Kriesing <wolfram@kriesing.de> + * @return boolean if the template was compiled + */ + function compiled() + { + return $this->_compiled; } /**

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