From e969f1b4fcea54576f7676aba1c35e4969001f63 Mon Sep 17 00:00:00 2001 From: Ivan Shalganov Date: Thu, 7 Feb 2013 19:22:13 +0400 Subject: [PATCH] Fix cache filename --- README.md | 2 ++ src/Aspect.php | 2 +- tests/cases/AspectTest.php | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c6dad0f..801c7e8 100644 --- a/README.md +++ b/README.md @@ -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) +[![Build Status](https://travis-ci.org/bzick/aspect.png?branch=master)](https://travis-ci.org/bzick/aspect) + Smarty-like syntax: ```smarty diff --git a/src/Aspect.php b/src/Aspect.php index bedcd35..513b13a 100644 --- a/src/Aspect.php +++ b/src/Aspect.php @@ -586,7 +586,7 @@ class Aspect { */ private function _getHash($tpl) { $hash = $tpl.":".$this->_options; - return basename($tpl).".".crc32($hash).".".strlen($hash).".php"; + return sprintf("%s.%u.%d.php", basename($tpl), crc32($hash), strlen($hash)); } /** diff --git a/tests/cases/AspectTest.php b/tests/cases/AspectTest.php index e57135b..4704047 100644 --- a/tests/cases/AspectTest.php +++ b/tests/cases/AspectTest.php @@ -16,7 +16,7 @@ class AspectTest extends \PHPUnit_Framework_TestCase { public function setUp() { self::tearDownAfterClass(); - $this->aspect = $aspect = new Aspect(); + $this->aspect = $aspect = Aspect::factory(ASPECT_RESOURCES.'/template', ASPECT_RESOURCES.'/compile'); $aspect->setCompileDir(ASPECT_RESOURCES.'/compile'); $aspect->addTemplateDir(ASPECT_RESOURCES.'/template'); $aspect->setForceCompile(false);