Commit eee94489 by seldaek

merging r309-311 from 1.1

git-svn-id: http://svn.dwoo.org/trunk@312 0598d79b-80c4-4d41-97ba-ac86fbbd088b
parent d3270dde
...@@ -26,6 +26,9 @@ ...@@ -26,6 +26,9 @@
* Fixed a Dwoo_Data bug in the append method when the index didn't exist * Fixed a Dwoo_Data bug in the append method when the index didn't exist
yet it threw a notice yet it threw a notice
* Fixed a bug when accessing global vars from a sub-template * Fixed a bug when accessing global vars from a sub-template
* Fixed a bug in the {dynamic} plugin
* Cached templates now check the source template for modification before
outputting the cached version
* Removed a couple of @-operator calls to file_get_contents * Removed a couple of @-operator calls to file_get_contents
[2009-07-18] 1.1.0 [2009-07-18] 1.1.0
......
...@@ -408,9 +408,8 @@ class Dwoo ...@@ -408,9 +408,8 @@ class Dwoo
// output // output
if ($_output === true) { if ($_output === true) {
echo $out; echo $out;
} else {
return $out;
} }
return $out;
} }
} }
} }
......
...@@ -263,7 +263,7 @@ class Dwoo_Template_String implements Dwoo_ITemplate ...@@ -263,7 +263,7 @@ class Dwoo_Template_String implements Dwoo_ITemplate
if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) { if (isset(self::$cache['cached'][$this->cacheId]) === true && file_exists($cachedFile)) {
// already checked, return cache file // already checked, return cache file
return $cachedFile; return $cachedFile;
} elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength))) { } elseif ($this->compilationEnforced !== true && file_exists($cachedFile) && ($cacheLength === -1 || filemtime($cachedFile) > ($_SERVER['REQUEST_TIME'] - $cacheLength)) && $this->isValidCompiledFile($this->getCompiledFilename($dwoo))) {
// cache is still valid and can be loaded // cache is still valid and can be loaded
self::$cache['cached'][$this->cacheId] = true; self::$cache['cached'][$this->cacheId] = true;
return $cachedFile; return $cachedFile;
......
...@@ -50,11 +50,11 @@ class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_ ...@@ -50,11 +50,11 @@ class Dwoo_Plugin_dynamic extends Dwoo_Block_Plugin implements Dwoo_ICompilable_
public static function unescape($output, $dynamicId) public static function unescape($output, $dynamicId)
{ {
return preg_replace_callback('/<dwoo:dynamic_('.$dynamicId.')>(.+?)<\/dwoo:dynamic_'.$dynamicId.'>/', array('self', 'unescapePhp'), $output); return preg_replace_callback('/<dwoo:dynamic_('.$dynamicId.')>(.+?)<\/dwoo:dynamic_'.$dynamicId.'>/s', array('self', 'unescapePhp'), $output);
} }
public static function unescapePhp($match) public static function unescapePhp($match)
{ {
return preg_replace('{<\?php /\*'.$match[1].'\*/ echo \'(.+?)\'; \?>}', '$1', $match[2]); return preg_replace('{<\?php /\*'.$match[1].'\*/ echo \'(.+?)\'; \?>}s', '$1', $match[2]);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment