Author: as
Date: Tue Jan 8 17:04:16 2008
New Revision: 7106
Log:
- Fixed issue #11056:
* fixed the cache file names in Windows (replace '\' with '-').
Added:
trunk/Template/tests/templates/subfolder/
trunk/Template/tests/templates/subfolder/subsubfolder/
trunk/Template/tests/templates/subfolder/subsubfolder/cache_block_simple.tpl
(with props)
Modified:
trunk/Template/ChangeLog
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_cached_transformer.php
trunk/Template/tests/cache_test.php
Modified: trunk/Template/ChangeLog
==============================================================================
--- trunk/Template/ChangeLog [iso-8859-1] (original)
+++ trunk/Template/ChangeLog [iso-8859-1] Tue Jan 8 17:04:16 2008
@@ -14,6 +14,7 @@
* {dynamic} is only allowed after {cache_template} or in {cache_block}.
* corrected documentation in regard to TTL vs. ttl.
+ * fixed the cache file names in Windows (replace '\' with '-').
1.2 - Monday 02 July 2007
Modified:
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_cached_transformer.php
==============================================================================
---
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_cached_transformer.php
[iso-8859-1] (original)
+++
trunk/Template/src/parsers/tst_to_ast/implementations/tst_to_ast_cached_transformer.php
[iso-8859-1] Tue Jan 8 17:04:16 2008
@@ -202,7 +202,7 @@
$fileName = $rpStream;
}
- $this->cacheBaseName =
$this->template->usedConfiguration->compilePath . DIRECTORY_SEPARATOR .
$this->template->usedConfiguration->cachedTemplatesPath . DIRECTORY_SEPARATOR .
str_replace( '/', "-", $fileName );
+ $this->cacheBaseName =
$this->template->usedConfiguration->compilePath . DIRECTORY_SEPARATOR .
$this->template->usedConfiguration->cachedTemplatesPath . DIRECTORY_SEPARATOR .
str_replace( DIRECTORY_SEPARATOR, "-", $fileName );
}
return $this->cacheBaseName;
Modified: trunk/Template/tests/cache_test.php
==============================================================================
--- trunk/Template/tests/cache_test.php [iso-8859-1] (original)
+++ trunk/Template/tests/cache_test.php [iso-8859-1] Tue Jan 8 17:04:16 2008
@@ -60,7 +60,24 @@
$this->fail( "Expected the directory to exists: " . $cacheDir );
}
}
-
+
+ public function testCacheBlockFileCreation()
+ {
+ $config = ezcTemplateConfiguration::getInstance();
+
+ $cacheDir = $config->compilePath . DIRECTORY_SEPARATOR .
"cached_templates";
+
+ $t = new ezcTemplate();
+ $t->send->user = new TestUser( "Bernard", "Black" );
+ $t->process( "subfolder/subsubfolder/cache_block_simple.tpl");
+
+ $this->assertEquals( true, file_exists( $config->compilePath .
"/cached_templates/-subfolder-subsubfolder-cache_block_simple.tpl[cb0]" ) );
+ if ( !file_exists( $config->compilePath . DIRECTORY_SEPARATOR .
"cached_templates" ) )
+ {
+ $this->fail( "Expected the directory to exists: " . $cacheDir );
+ }
+ }
+
//
/////////////////////////////////////////////////////////////////////////////////////////
// Cache blocks
Added:
trunk/Template/tests/templates/subfolder/subsubfolder/cache_block_simple.tpl
==============================================================================
---
trunk/Template/tests/templates/subfolder/subsubfolder/cache_block_simple.tpl
(added)
+++
trunk/Template/tests/templates/subfolder/subsubfolder/cache_block_simple.tpl
[iso-8859-1] Tue Jan 8 17:04:16 2008
@@ -1,0 +1,3 @@
+{cache_block}
+[cached]
+{/cache_block}
Propchange:
trunk/Template/tests/templates/subfolder/subsubfolder/cache_block_simple.tpl
------------------------------------------------------------------------------
svn:eol-style = native
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components