Skip to content
  • 4 commits
  • 6 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 06, 2012
rodneyrehm improvement stream_resolve_include_path() added to Smarty_Internal_Ge…
…t_Include_Path (Forum Topic 20980)

git-svn-id: http://smarty-php.googlecode.com/svn/trunk@4546 9dce5a81-9a42-0410-99e4-3799d3902e7f
f633b6e
rodneyrehm todo
git-svn-id: http://smarty-php.googlecode.com/svn/trunk@4547 9dce5a81-9a42-0410-99e4-3799d3902e7f
d458d9a
rodneyrehm bugfix fetch('extends:foo.tpl') always yielded $source->exists == tru…
…e (Forum Topic 20980)

git-svn-id: http://smarty-php.googlecode.com/svn/trunk@4548 9dce5a81-9a42-0410-99e4-3799d3902e7f
9dcdea0
rodneyrehm unit test maintenance todo
git-svn-id: http://smarty-php.googlecode.com/svn/trunk@4549 9dce5a81-9a42-0410-99e4-3799d3902e7f
5627722
View
12 development/PHPunit/ExtendsResourceTests.php
@@ -90,6 +90,8 @@ public function testExtendsTagWithExtendsResource()
*/
public function testCompileBlockGrandChildMustCompile1()
{
+ // FIXME: this tests fails when run with smartytestssingle.php
+ // $this->smarty->clearCache('extends:test_block_parent.tpl|test_block_child_resource.tpl|test_block_grandchild_resource.tpl');
$this->smarty->caching = true;
$this->smarty->cache_lifetime = 1000;
$tpl = $this->smarty->createTemplate('extends:test_block_parent.tpl|test_block_child_resource.tpl|test_block_grandchild_resource.tpl');
@@ -191,6 +193,16 @@ public function testExtendResource2()
$this->assertContains('--parent from --base-- block--', $result);
$this->assertContains('--block include ok--', $result);
}
+
+ public function testExtendExists()
+ {
+ $this->smarty->caching = false;
+ $tpl = $this->smarty->createTemplate('extends:test_block_base.tpl');
+ $this->assertTrue($tpl->source->exists);
+
+ $tpl = $this->smarty->createTemplate('extends:does-not-exists.tpl|this-neither.tpl');
+ $this->assertFalse($tpl->source->exists);
+ }
}
?>
View
2 development/PHPunit/smartytestssingle.php
@@ -80,7 +80,7 @@ public static function init()
public static function suite()
{
$testorder = array(
- 'SecurityTests',
+ 'ExtendsResourceTests',
// 'PluginFunctionHtmlImageTests',
// 'PluginFunctionFetchTests',
);
View
4 distribution/change_log.txt
@@ -1,4 +1,8 @@
===== trunk =====
+06.02.2012
+- improvement stream_resolve_include_path() added to Smarty_Internal_Get_Include_Path (Forum Topic 20980)
+- bugfix fetch('extends:foo.tpl') always yielded $source->exists == true (Forum Topic 20980)
+
30.01.2012
- bugfix Smarty_Security internal $_resource_dir cache wasn't properly propagated
View
1 distribution/libs/plugins/outputfilter.trimwhitespace.php
@@ -15,6 +15,7 @@
* @param string $source input string
* @param Smarty_Internal_Template $smarty Smarty object
* @return string filtered output
+ * @todo substr_replace() is not overloaded by mbstring.func_overload - so this function might fail!
*/
function smarty_outputfilter_trimwhitespace($source, Smarty_Internal_Template $smarty)
{
View
5 distribution/libs/sysplugins/smarty_internal_get_include_path.php
@@ -24,6 +24,11 @@ class Smarty_Internal_Get_Include_Path {
public static function getIncludePath($filepath)
{
static $_include_path = null;
+
+ if (function_exists('stream_resolve_include_path')) {
+ // available since PHP 5.3.2
+ return stream_resolve_include_path($filepath);
+ }
if ($_include_path === null) {
$_include_path = explode(PATH_SEPARATOR, get_include_path());
View
4 distribution/libs/sysplugins/smarty_internal_resource_extends.php
@@ -45,7 +45,7 @@ public function populate(Smarty_Template_Source $source, Smarty_Internal_Templat
$sources[$s->uid] = $s;
$uid .= $s->filepath;
if ($_template && $_template->smarty->compile_check) {
- $exists == $exists && $s->exists;
+ $exists = $exists && $s->exists;
}
}
$source->components = $sources;
@@ -68,7 +68,7 @@ public function populateTimestamp(Smarty_Template_Source $source)
{
$source->exists = true;
foreach ($source->components as $s) {
- $source->exists == $source->exists && $s->exists;
+ $source->exists = $source->exists && $s->exists;
}
$source->timestamp = $s->timestamp;
}

No commit comments for this range

Something went wrong with that request. Please try again.