| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of Mustache.php. |
| 5 |
* |
| 6 |
* (c) 2010-2014 Justin Hileman |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
/** |
| 13 |
* Mustache Cache in-memory implementation. |
| 14 |
* |
| 15 |
* The in-memory cache is used for uncached lambda section templates. It's also useful during development, but is not |
| 16 |
* recommended for production use. |
| 17 |
*/ |
| 18 |
class Mustache_Cache_NoopCache extends Mustache_Cache_AbstractCache |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Loads nothing. Move along. |
| 22 |
* |
| 23 |
* @param string $key |
| 24 |
* |
| 25 |
* @return boolean |
| 26 |
*/ |
| 27 |
public function load($key) |
| 28 |
{ |
| 29 |
return false; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Loads the compiled Mustache Template class without caching. |
| 34 |
* |
| 35 |
* @param string $key |
| 36 |
* @param string $value |
| 37 |
* |
| 38 |
* @return void |
| 39 |
*/ |
| 40 |
public function cache($key, $value) |
| 41 |
{ |
| 42 |
$this->log( |
| 43 |
Mustache_Logger::WARNING, |
| 44 |
'Template cache disabled, evaluating "{className}" class at runtime', |
| 45 |
array('className' => $key) |
| 46 |
); |
| 47 |
eval('?>' . $value); |
| 48 |
} |
| 49 |
} |
| 50 |
|