Restore original eval vs. require class loading

Pushing the responsibility of class loading onto the `Mustache_Cache`
implementation and changing the semantics of get/put to load/cache.
This commit is contained in:
Amit Snyderman
2013-09-05 18:56:43 -04:00
parent 71eaed2778
commit 94cd72bfd4
5 changed files with 59 additions and 45 deletions
@@ -19,20 +19,20 @@ class Mustache_Test_Cache_FilesystemCacheTest extends PHPUnit_Framework_TestCase
{
$key = 'some key';
$cache = new Mustache_Cache_FilesystemCache(self::$tempDir);;
$cached = $cache->get($key);
$loaded = $cache->load($key);
$this->assertNull($cached);
$this->assertFalse($loaded);
}
public function testCachePut()
{
$key = 'some key';
$value = 'some value';
$value = '<?php /* some value */';
$cache = new Mustache_Cache_FilesystemCache(self::$tempDir);;
$cache->put($key, $value);
$cached = $cache->get($key);
$cache->cache($key, $value);
$loaded = $cache->load($key);
$this->assertEquals($cached, $value);
$this->assertTrue($loaded);
}
private static function rmdir($path)