@@ -966,10 +966,10 @@ discard block |
||
| 966 | 966 | */ |
| 967 | 967 | public function getFunctionName() |
| 968 | 968 | { |
| 969 | - // function name is used as base for caching, so it must be unique for |
|
| 970 | - // every combination of settings that changes code in compiled template |
|
| 969 | + // function name is used as base for caching, so it must be unique for |
|
| 970 | + // every combination of settings that changes code in compiled template |
|
| 971 | 971 | |
| 972 | - if (!$this->_functionName) { |
|
| 972 | + if (!$this->_functionName) { |
|
| 973 | 973 | |
| 974 | 974 | // just to make tempalte name recognizable |
| 975 | 975 | $basename = preg_replace('/\.[a-z]{3,5}$/', '', basename($this->_source->getRealPath())); |
@@ -989,7 +989,7 @@ discard block |
||
| 989 | 989 | $hash = strtr(rtrim(base64_encode($hash),"="),"+/=","_A_"); |
| 990 | 990 | |
| 991 | 991 | $this->_functionName = $this->getFunctionNamePrefix($this->_source->getLastModifiedTime()) . |
| 992 | - $basename . '__' . $hash; |
|
| 992 | + $basename . '__' . $hash; |
|
| 993 | 993 | } |
| 994 | 994 | return $this->_functionName; |
| 995 | 995 | } |
@@ -379,7 +379,9 @@ discard block |
||
| 379 | 379 | $enc = strtoupper($enc); |
| 380 | 380 | if ($enc != $this->_encoding) { |
| 381 | 381 | $this->_encoding = $enc; |
| 382 | - if ($this->_translator) $this->_translator->setEncoding($enc); |
|
| 382 | + if ($this->_translator) { |
|
| 383 | + $this->_translator->setEncoding($enc); |
|
| 384 | + } |
|
| 383 | 385 | |
| 384 | 386 | $this->resetPrepared(); |
| 385 | 387 | } |
@@ -666,8 +668,7 @@ discard block |
||
| 666 | 668 | ob_start(); |
| 667 | 669 | $templateFunction($this, $this->_context); |
| 668 | 670 | $res = ob_get_clean(); |
| 669 | - } |
|
| 670 | - catch (Exception $e) |
|
| 671 | + } catch (Exception $e) |
|
| 671 | 672 | { |
| 672 | 673 | ob_end_clean(); |
| 673 | 674 | throw $e; |
@@ -686,8 +687,7 @@ discard block |
||
| 686 | 687 | if ($this->_postfilter) { |
| 687 | 688 | return $this->_postfilter->filter($res); |
| 688 | 689 | } |
| 689 | - } |
|
| 690 | - catch (Exception $e) |
|
| 690 | + } catch (Exception $e) |
|
| 691 | 691 | { |
| 692 | 692 | PHPTAL_ExceptionHandler::handleException($e, $this->getEncoding()); |
| 693 | 693 | } |
@@ -717,8 +717,7 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | $templateFunction = $this->getFunctionName(); |
| 719 | 719 | $templateFunction($this, $this->_context); |
| 720 | - } |
|
| 721 | - catch (Exception $e) |
|
| 720 | + } catch (Exception $e) |
|
| 722 | 721 | { |
| 723 | 722 | PHPTAL_ExceptionHandler::handleException($e, $this->getEncoding()); |
| 724 | 723 | } |
@@ -835,8 +834,7 @@ discard block |
||
| 835 | 834 | ob_start(); |
| 836 | 835 | try { |
| 837 | 836 | eval("?>\n".$result); |
| 838 | - } |
|
| 839 | - catch(Exception $e) { |
|
| 837 | + } catch(Exception $e) { |
|
| 840 | 838 | ob_end_clean(); |
| 841 | 839 | throw $e; |
| 842 | 840 | } |
@@ -845,7 +843,11 @@ discard block |
||
| 845 | 843 | $msg = str_replace('eval()\'d code', $this->getCodePath(), ob_get_clean()); |
| 846 | 844 | |
| 847 | 845 | // greedy .* ensures last match |
| 848 | - if (preg_match('/.*on line (\d+)$/m', $msg, $m)) $line=$m[1]; else $line=0; |
|
| 846 | + if (preg_match('/.*on line (\d+)$/m', $msg, $m)) { |
|
| 847 | + $line=$m[1]; |
|
| 848 | + } else { |
|
| 849 | + $line=0; |
|
| 850 | + } |
|
| 849 | 851 | throw new PHPTAL_TemplateException(trim($msg), $this->getCodePath(), $line); |
| 850 | 852 | } |
| 851 | 853 | ob_end_clean(); |
@@ -939,7 +941,10 @@ discard block |
||
| 939 | 941 | $cacheFiles = glob($filename . '?*'); |
| 940 | 942 | if ($cacheFiles) { |
| 941 | 943 | foreach ($cacheFiles as $file) { |
| 942 | - if (substr($file, 0, strlen($filename)) !== $filename) continue; // safety net |
|
| 944 | + if (substr($file, 0, strlen($filename)) !== $filename) { |
|
| 945 | + continue; |
|
| 946 | + } |
|
| 947 | + // safety net |
|
| 943 | 948 | @unlink($file); |
| 944 | 949 | } |
| 945 | 950 | } |
@@ -956,7 +961,9 @@ discard block |
||
| 956 | 961 | */ |
| 957 | 962 | public function getCodePath() |
| 958 | 963 | { |
| 959 | - if (!$this->_codeFile) $this->setCodeFile(); |
|
| 964 | + if (!$this->_codeFile) { |
|
| 965 | + $this->setCodeFile(); |
|
| 966 | + } |
|
| 960 | 967 | return $this->_codeFile; |
| 961 | 968 | } |
| 962 | 969 | |
@@ -1187,7 +1194,9 @@ discard block |
||
| 1187 | 1194 | $class = strtr($class, '\\', '_'); |
| 1188 | 1195 | } |
| 1189 | 1196 | |
| 1190 | - if (substr($class, 0, 7) !== 'PHPTAL_') return; |
|
| 1197 | + if (substr($class, 0, 7) !== 'PHPTAL_') { |
|
| 1198 | + return; |
|
| 1199 | + } |
|
| 1191 | 1200 | |
| 1192 | 1201 | $path = dirname(__FILE__) . strtr("_".$class, "_", DIRECTORY_SEPARATOR) . '.php'; |
| 1193 | 1202 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Information about TAL attributes (in which order they are executed and how they generate the code) |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Wrong macro name in metal:use-macro |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * ${unknown:foo} found in template |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @package PHPTAL |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * PHPTAL templating engine |
|
| 4 | - * |
|
| 5 | - * PHP Version 5 |
|
| 6 | - * |
|
| 7 | - * @category HTML |
|
| 8 | - * @package PHPTAL |
|
| 9 | - * @author Laurent Bedubourg <[email protected]> |
|
| 10 | - * @author Kornel Lesiński <[email protected]> |
|
| 11 | - * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | - * @version SVN: $Id$ |
|
| 13 | - * @link http://phptal.org/ |
|
| 14 | - */ |
|
| 3 | + * PHPTAL templating engine |
|
| 4 | + * |
|
| 5 | + * PHP Version 5 |
|
| 6 | + * |
|
| 7 | + * @category HTML |
|
| 8 | + * @package PHPTAL |
|
| 9 | + * @author Laurent Bedubourg <[email protected]> |
|
| 10 | + * @author Kornel Lesiński <[email protected]> |
|
| 11 | + * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License |
|
| 12 | + * @version SVN: $Id$ |
|
| 13 | + * @link http://phptal.org/ |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | |
| 17 | 17 | /** |