Fix cache filename

This commit is contained in:
Ivan Shalganov 2013-02-07 19:22:13 +04:00
parent bf6d2231f4
commit e969f1b4fc
3 changed files with 4 additions and 2 deletions

View File

@ -3,6 +3,8 @@ Aspect PHP Template Engine
## [About](./docs/about.md) | [Documentation](./docs/main.md) | [Benchmark](./docs/benchmark.md) | [Bugs](https://github.com/bzick/aspect/issues) | [Articles](./docs/articles.md) ## [About](./docs/about.md) | [Documentation](./docs/main.md) | [Benchmark](./docs/benchmark.md) | [Bugs](https://github.com/bzick/aspect/issues) | [Articles](./docs/articles.md)
[![Build Status](https://travis-ci.org/bzick/aspect.png?branch=master)](https://travis-ci.org/bzick/aspect)
Smarty-like syntax: Smarty-like syntax:
```smarty ```smarty

View File

@ -586,7 +586,7 @@ class Aspect {
*/ */
private function _getHash($tpl) { private function _getHash($tpl) {
$hash = $tpl.":".$this->_options; $hash = $tpl.":".$this->_options;
return basename($tpl).".".crc32($hash).".".strlen($hash).".php"; return sprintf("%s.%u.%d.php", basename($tpl), crc32($hash), strlen($hash));
} }
/** /**

View File

@ -16,7 +16,7 @@ class AspectTest extends \PHPUnit_Framework_TestCase {
public function setUp() { public function setUp() {
self::tearDownAfterClass(); self::tearDownAfterClass();
$this->aspect = $aspect = new Aspect(); $this->aspect = $aspect = Aspect::factory(ASPECT_RESOURCES.'/template', ASPECT_RESOURCES.'/compile');
$aspect->setCompileDir(ASPECT_RESOURCES.'/compile'); $aspect->setCompileDir(ASPECT_RESOURCES.'/compile');
$aspect->addTemplateDir(ASPECT_RESOURCES.'/template'); $aspect->addTemplateDir(ASPECT_RESOURCES.'/template');
$aspect->setForceCompile(false); $aspect->setForceCompile(false);