From 7cb5f3f08f044ae5049896a9b3902f8855529299 Mon Sep 17 00:00:00 2001 From: Brendan Anderson Date: Thu, 15 Dec 2016 13:23:46 -0500 Subject: [PATCH 01/24] Prevent redundant autoloader registerations. Fixes #304 --- src/Mustache/Autoloader.php | 16 +++++++++++++++- test/Mustache/Test/AutoloaderTest.php | 17 +++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Mustache/Autoloader.php b/src/Mustache/Autoloader.php index b16ac142..5cb2a456 100644 --- a/src/Mustache/Autoloader.php +++ b/src/Mustache/Autoloader.php @@ -16,6 +16,14 @@ class Mustache_Autoloader { private $baseDir; + /** + * An array where the key is the baseDir and the key is an instance of this + * class. + * + * @var array + */ + static private $instances; + /** * Autoloader constructor. * @@ -45,7 +53,13 @@ public function __construct($baseDir = null) */ public static function register($baseDir = null) { - $loader = new self($baseDir); + $key = $baseDir ? $baseDir : 0; + + if (!isset(self::$instances[$key])) { + self::$instances[$key] = new self($baseDir); + } + + $loader = self::$instances[$key]; spl_autoload_register(array($loader, 'autoload')); return $loader; diff --git a/test/Mustache/Test/AutoloaderTest.php b/test/Mustache/Test/AutoloaderTest.php index 40af5eec..dfe6638b 100644 --- a/test/Mustache/Test/AutoloaderTest.php +++ b/test/Mustache/Test/AutoloaderTest.php @@ -33,4 +33,21 @@ public function testAutoloader() $loader->autoload('\Mustache_Bar'); $this->assertTrue(class_exists('Mustache_Bar')); } + + /** + * Test that the autoloader won't register multiple times. + * + * @return void + */ + public function testRegisterMultiple() + { + $numLoaders = count(spl_autoload_functions()); + + Mustache_Autoloader::register(); + Mustache_Autoloader::register(); + + $expectedNumLoaders = $numLoaders + 1; + + $this->assertCount($expectedNumLoaders, spl_autoload_functions()); + } } From 44baf86426397429f293b63cefb8dd298a986649 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 28 Jun 2017 23:20:21 -0700 Subject: [PATCH 02/24] Suppress `else` when rendering empty block defaults. --- src/Mustache/Compiler.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 2a831d6e..dd40d8ac 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -240,10 +240,11 @@ private function writeCode($tree, $name) $blockFunction = $context->findInBlock(%s); if (is_callable($blockFunction)) { $buffer .= call_user_func($blockFunction, $context); - } else {%s - } + %s} '; + const BLOCK_VAR_ELSE = '} else {%s'; + /** * Generate Mustache Template inheritance block variable PHP source. * @@ -261,7 +262,12 @@ private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level) { $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level)); + $else = $this->walk($nodes, $level); + if ($else !== '') { + $else = sprintf($this->prepare(self::BLOCK_VAR_ELSE, $level + 1, false, true), $else); + } + + return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $else); } const BLOCK_ARG = '$blocksContext[%s] = array($this, \'block%s\');'; From 09241edd52bab2ac6b78c21919f060c680aa4e8e Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 29 Jun 2017 00:13:59 -0700 Subject: [PATCH 03/24] Use a local $blocksContext for each parent render. ... rather than a shared one per template / section / block that accidentally keeps old block context around. Fixes #322 --- src/Mustache/Compiler.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index dd40d8ac..34c39583 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -191,7 +191,6 @@ public function renderInternal(Mustache_Context $context, $indent = \'\') { $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context); $buffer = \'\'; - $blocksContext = array(); %s return $buffer; @@ -207,7 +206,6 @@ class %s extends Mustache_Template public function renderInternal(Mustache_Context $context, $indent = \'\') { $buffer = \'\'; - $blocksContext = array(); %s return $buffer; @@ -270,7 +268,7 @@ private function blockVar($nodes, $id, $start, $end, $otag, $ctag, $level) return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $else); } - const BLOCK_ARG = '$blocksContext[%s] = array($this, \'block%s\');'; + const BLOCK_ARG = '%s => array($this, \'block%s\'),'; /** * Generate Mustache Template inheritance block argument PHP source. @@ -291,14 +289,13 @@ private function blockArg($nodes, $id, $start, $end, $otag, $ctag, $level) $keystr = var_export($key, true); $id = var_export($id, true); - return sprintf($this->prepare(self::BLOCK_ARG, 1), $id, $key); + return sprintf($this->prepare(self::BLOCK_ARG, $level), $id, $key); } const BLOCK_FUNCTION = ' public function block%s($context) { - $indent = $buffer = \'\'; - $blocksContext = array();%s + $indent = $buffer = \'\';%s return $buffer; } @@ -333,7 +330,6 @@ private function block($nodes) private function section%s(Mustache_Context $context, $indent, $value) { $buffer = \'\'; - $blocksContext = array(); if (%s) { $source = %s; @@ -463,15 +459,20 @@ private function partial($id, $indent, $level) } const PARENT = ' - %s - if ($parent = $this->mustache->loadPartial(%s)) { - $context->pushBlockContext($blocksContext); + $context->pushBlockContext(array(%s + )); $buffer .= $parent->renderInternal($context, $indent); $context->popBlockContext(); } '; + const PARENT_NO_CONTEXT = ' + if ($parent = $this->mustache->loadPartial(%s)) { + $buffer .= $parent->renderInternal($context, $indent); + } + '; + /** * Generate Mustache Template inheritance parent call PHP source. * @@ -486,11 +487,14 @@ private function parent($id, $indent, array $children, $level) { $realChildren = array_filter($children, array(__CLASS__, 'onlyBlockArgs')); + if (empty($realChildren)) { + return sprintf($this->prepare(self::PARENT_NO_CONTEXT, $level), var_export($id, true)); + } + return sprintf( $this->prepare(self::PARENT, $level), - $this->walk($realChildren, $level), var_export($id, true), - var_export($indent, true) + $this->walk($realChildren, $level + 1) ); } From 40646e4aea58c8953d6d59f0b842f038072cc620 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 29 Jun 2017 06:02:16 -0700 Subject: [PATCH 04/24] Fix Travis PHP 7 and HHVM builds. --- .travis.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index e68b99c6..1c64e6f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,17 @@ language: php -php: - - 5.2 - - 5.3 - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - hhvm +sudo: false -script: - - phpunit +matrix: + include: + - php: 5.2 + - php: 5.3 + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: hhvm + dist: trusty -sudo: false +script: vendor/bin/phpunit --verbose From 9e34408bda6b3d950ccf86c2d626402cec5c68d5 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 29 Jun 2017 06:21:49 -0700 Subject: [PATCH 05/24] Add a failing test case for #322 --- .../Test/Functional/InheritanceTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/Mustache/Test/Functional/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index b39555f6..598d959a 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -227,6 +227,23 @@ public function testOverriddenPartial() $this->assertEquals('test |override1 default| |override2 default|', $tpl->render($data)); } + public function testBlocksDoNotLeakBetweenPartials() + { + $partials = array( + 'partial' => '|{{$a}}A{{/a}} {{$b}}B{{/b}}|', + ); + + $this->mustache->setPartials($partials); + + $tpl = $this->mustache->loadTemplate( + 'test {{assertEquals('test |C B| |A D|', $tpl->render($data)); + } + public function testDataDoesNotOverrideBlock() { $partials = array( From b6a480df228b20e3e05b5a34aa82c859a0be4388 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 29 Jun 2017 06:35:34 -0700 Subject: [PATCH 06/24] o right, test all the versions we support. --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1c64e6f4..99de817a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,4 +14,8 @@ matrix: - php: hhvm dist: trusty -script: vendor/bin/phpunit --verbose +script: + - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] && phpunit || vendor/bin/phpunit --verbose' + +install: + - '[[ "$TRAVIS_PHP_VERSION" = 5.2* ]] || composer install' From 329146d8641e217e2315f0a1525adc7d2e2fd838 Mon Sep 17 00:00:00 2001 From: Jager Mesh Date: Wed, 5 Apr 2017 12:11:24 -0400 Subject: [PATCH 07/24] support for delimiters configuration --- src/Mustache/Engine.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 856d4efe..844335c5 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -54,6 +54,7 @@ class Mustache_Engine private $logger; private $strictCallables = false; private $pragmas = array(); + private $delimiters = '{{ }}'; // Services private $tokenizer; @@ -191,6 +192,10 @@ public function __construct(array $options = array()) $this->strictCallables = $options['strict_callables']; } + if (isset($options['delimiters'])) { + $this->delimiters = $options['delimiters']; + } + if (isset($options['pragmas'])) { foreach ($options['pragmas'] as $pragma) { if (!isset(self::$knownPragmas[$pragma])) { @@ -725,7 +730,7 @@ private function loadSource($source, Mustache_Cache $cache = null) */ private function tokenize($source) { - return $this->getTokenizer()->scan($source); + return $this->getTokenizer()->scan($source, $this->delimiters); } /** From 44489124a12403f299fc91f3e93611e4c2ea58d8 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 08:39:34 -0700 Subject: [PATCH 08/24] CS fixes. --- src/Mustache/Autoloader.php | 2 +- test/Mustache/Test/AutoloaderTest.php | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Mustache/Autoloader.php b/src/Mustache/Autoloader.php index 5cb2a456..3fdadd2e 100644 --- a/src/Mustache/Autoloader.php +++ b/src/Mustache/Autoloader.php @@ -22,7 +22,7 @@ class Mustache_Autoloader * * @var array */ - static private $instances; + private static $instances; /** * Autoloader constructor. diff --git a/test/Mustache/Test/AutoloaderTest.php b/test/Mustache/Test/AutoloaderTest.php index dfe6638b..f7a1ccff 100644 --- a/test/Mustache/Test/AutoloaderTest.php +++ b/test/Mustache/Test/AutoloaderTest.php @@ -33,21 +33,19 @@ public function testAutoloader() $loader->autoload('\Mustache_Bar'); $this->assertTrue(class_exists('Mustache_Bar')); } - + /** * Test that the autoloader won't register multiple times. - * - * @return void */ public function testRegisterMultiple() { $numLoaders = count(spl_autoload_functions()); - + Mustache_Autoloader::register(); Mustache_Autoloader::register(); - + $expectedNumLoaders = $numLoaders + 1; - + $this->assertCount($expectedNumLoaders, spl_autoload_functions()); } } From ccb2b0931706888cd9c200c1ec6f84ce86585790 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 14:36:52 -0700 Subject: [PATCH 09/24] Update generated class name for delimiters option. Add some docs there, make it slightly easier to update the generated class name. --- src/Mustache/Engine.php | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 844335c5..9b68bc8a 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -594,22 +594,34 @@ protected function getLambdaCache() /** * Helper method to generate a Mustache template class. * + * This method must be updated any time options are added which make it so + * the same template could be parsed and compiled multiple different ways. + * * @param string $source * * @return string Mustache Template class name */ public function getTemplateClassName($source) { - return $this->templateClassPrefix . md5(sprintf( - 'version:%s,escape:%s,entity_flags:%i,charset:%s,strict_callables:%s,pragmas:%s,source:%s', - self::VERSION, - isset($this->escape) ? 'custom' : 'default', - $this->entityFlags, - $this->charset, - $this->strictCallables ? 'true' : 'false', - implode(' ', $this->getPragmas()), - $source - )); + // For the most part, adding a new option here should do the trick. + // + // Pick a value here which is unique for each possible way the template + // could be compiled... but not necessarily unique per option value. See + // escape below, which only needs to differentiate between 'custom' and + // 'default' escapes. + // + // Keep this list in alphabetical order :) + $options = array( + 'charset' => $this->charset, + 'delimiters' => $this->delimiters, + 'entityFlags' => $this->entityFlags, + 'escape' => isset($this->escape) ? 'custom' : 'default', + 'pragmas' => $this->getPragmas(), + 'strictCallables' => $this->strictCallables, + 'version' => self::VERSION, + ); + + return $this->templateClassPrefix . md5(json_encode($options) . "\n" . $source); } /** From 31523441e110d307e3bba09a079e3e7f4ff3dffd Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 14:46:56 -0700 Subject: [PATCH 10/24] Add `delimiters` option docs. --- src/Mustache/Engine.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 9b68bc8a..e843d1ee 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -82,6 +82,14 @@ class Mustache_Engine * // sections are often too dynamic to benefit from caching. * 'cache_lambda_templates' => true, * + * // Customize the tag delimiters used by this engine instance. Note that overriding here changes the + * // delimiters used to parse all templates and partials loaded by this instance. To override just for a + * // single template, use an inline "change delimiters" tag at the start of the template file: + * // + * // {{=<% %>=}} + * // + * 'delimiters' => '<% %>', + * * // A Mustache template loader instance. Uses a StringLoader if not specified. * 'loader' => new Mustache_Loader_FilesystemLoader(dirname(__FILE__).'/views'), * From ca19ba467e82baae32ab9aa516b44b28435c0208 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Wed, 6 Apr 2016 06:22:26 -0700 Subject: [PATCH 11/24] Initial production FilesystemSource implementation See #290 --- src/Mustache/Engine.php | 22 +++-- src/Mustache/Loader.php | 2 +- .../Loader/ProductionFilesystemLoader.php | 40 +++++++++ src/Mustache/Source.php | 32 ++++++++ src/Mustache/Source/FilesystemSource.php | 64 +++++++++++++++ test/Mustache/Test/EngineTest.php | 9 ++ .../Loader/ProductionFilesystemLoaderTest.php | 82 +++++++++++++++++++ 7 files changed, 244 insertions(+), 7 deletions(-) create mode 100644 src/Mustache/Loader/ProductionFilesystemLoader.php create mode 100644 src/Mustache/Source.php create mode 100644 src/Mustache/Source/FilesystemSource.php create mode 100644 test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index e843d1ee..38c05c9b 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -605,12 +605,18 @@ protected function getLambdaCache() * This method must be updated any time options are added which make it so * the same template could be parsed and compiled multiple different ways. * - * @param string $source + * @param string|Mustache_Source $source * * @return string Mustache Template class name */ public function getTemplateClassName($source) { + if ($source instanceof Mustache_Source) { + $key = $source->getKey(); + } else { + $key = sprintf('source:%s', $source); + } + // For the most part, adding a new option here should do the trick. // // Pick a value here which is unique for each possible way the template @@ -629,7 +635,7 @@ public function getTemplateClassName($source) 'version' => self::VERSION, ); - return $this->templateClassPrefix . md5(json_encode($options) . "\n" . $source); + return $this->templateClassPrefix . md5(json_encode($options) . "\n" . $key); } /** @@ -706,8 +712,8 @@ public function loadLambda($source, $delims = null) * @see Mustache_Engine::loadPartial * @see Mustache_Engine::loadLambda * - * @param string $source - * @param Mustache_Cache $cache (default: null) + * @param string|Mustache_Source $source + * @param Mustache_Cache $cache (default: null) * * @return Mustache_Template */ @@ -775,13 +781,12 @@ private function parse($source) * * @see Mustache_Compiler::compile * - * @param string $source + * @param string|Mustache_Source $source * * @return string generated Mustache template class code */ private function compile($source) { - $tree = $this->parse($source); $name = $this->getTemplateClassName($source); $this->log( @@ -790,6 +795,11 @@ private function compile($source) array('className' => $name) ); + if ($source instanceof Mustache_Source) { + $source = $source->getSource(); + } + $tree = $this->parse($source); + $compiler = $this->getCompiler(); $compiler->setPragmas($this->getPragmas()); diff --git a/src/Mustache/Loader.php b/src/Mustache/Loader.php index c5e1a19a..b8be775e 100644 --- a/src/Mustache/Loader.php +++ b/src/Mustache/Loader.php @@ -21,7 +21,7 @@ interface Mustache_Loader * * @param string $name * - * @return string Mustache Template source + * @return string|Mustache_Source Mustache Template source */ public function load($name); } diff --git a/src/Mustache/Loader/ProductionFilesystemLoader.php b/src/Mustache/Loader/ProductionFilesystemLoader.php new file mode 100644 index 00000000..a79b6f4b --- /dev/null +++ b/src/Mustache/Loader/ProductionFilesystemLoader.php @@ -0,0 +1,40 @@ +getFileName($name); + + if (!file_exists($fileName)) { + throw new Mustache_Exception_UnknownTemplateException($name); + } + + return new Mustache_Source_FilesystemSource($fileName); + } +} diff --git a/src/Mustache/Source.php b/src/Mustache/Source.php new file mode 100644 index 00000000..3eded910 --- /dev/null +++ b/src/Mustache/Source.php @@ -0,0 +1,32 @@ +filename = $filename; + } + + /** + * Get the Source key (used to generate the compiled class name). + * + * @throws RuntimeException when a source file cannot be read + * + * @return string + */ + public function getKey() + { + if (!isset($this->stat)) { + $this->stat = stat($this->filename); + } + + if ($this->stat === false) { + throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->filename)); + } + + return sprintf('filename:%s,size:%s,mtime:%s', $this->filename, $this->stat['size'], $this->stat['mtime']); + } + + /** + * Get the template Source. + * + * @return string + */ + public function getSource() + { + return file_get_contents($this->filename); + } +} diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index e8743d78..eb5a27a3 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -331,6 +331,15 @@ public function testUnknownPragmaThrowsException() )); } + public function testCompileFromMustacheSourceInstance() + { + $baseDir = realpath(dirname(__FILE__) . '/../../fixtures/templates'); + $mustache = new Mustache_Engine(array( + 'loader' => new Mustache_Loader_ProductionFilesystemLoader($baseDir), + )); + $this->assertEquals('one contents', $mustache->render('one')); + } + private function getLoggedMustache($level = Mustache_Logger::ERROR) { $name = tempnam(sys_get_temp_dir(), 'mustache-test'); diff --git a/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php new file mode 100644 index 00000000..300b6e84 --- /dev/null +++ b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php @@ -0,0 +1,82 @@ + '.ms')); + $this->assertInstanceOf('Mustache_Source', $loader->load('alpha')); + $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); + $this->assertInstanceOf('Mustache_Source', $loader->load('beta.ms')); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + public function testTrailingSlashes() + { + $baseDir = dirname(__FILE__) . '/../../../fixtures/templates/'; + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')->getSource()); + } + + public function testConstructorWithProtocol() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_ProductionFilesystemLoader('file://' . $baseDir, array('extension' => '.ms')); + $this->assertEquals('alpha contents', $loader->load('alpha')->getSource()); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + public function testLoadTemplates() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + $this->assertEquals('one contents', $loader->load('one')->getSource()); + $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); + } + + public function testEmptyExtensionString() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => '')); + $this->assertEquals('one contents', $loader->load('one.mustache')->getSource()); + $this->assertEquals('alpha contents', $loader->load('alpha.ms')->getSource()); + + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('extension' => null)); + $this->assertEquals('two contents', $loader->load('two.mustache')->getSource()); + $this->assertEquals('beta contents', $loader->load('beta.ms')->getSource()); + } + + /** + * @expectedException Mustache_Exception_RuntimeException + */ + public function testMissingBaseDirThrowsException() + { + new Mustache_Loader_ProductionFilesystemLoader(dirname(__FILE__) . '/not_a_directory'); + } + + /** + * @expectedException Mustache_Exception_UnknownTemplateException + */ + public function testMissingTemplateThrowsException() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $loader = new Mustache_Loader_ProductionFilesystemLoader($baseDir); + + $loader->load('fake'); + } +} From 1514e0c2cd538b5264ce4bdc3469f7cd3a2eab64 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Fri, 8 Apr 2016 06:56:52 -0700 Subject: [PATCH 12/24] Add stat() options to ProductionFilesystemLoader * By default, continue to use `size` and `mtime` to invalidate template cache * Allow overriding to use any properties of `stat()` * Allow disabling stat entirely * Add a Big Kid Pants disclaimer if you choose to go down this path --- .../Loader/ProductionFilesystemLoader.php | 48 ++++++++++++++++++- src/Mustache/Source/FilesystemSource.php | 29 +++++++---- 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/src/Mustache/Loader/ProductionFilesystemLoader.php b/src/Mustache/Loader/ProductionFilesystemLoader.php index a79b6f4b..85428f05 100644 --- a/src/Mustache/Loader/ProductionFilesystemLoader.php +++ b/src/Mustache/Loader/ProductionFilesystemLoader.php @@ -18,6 +18,52 @@ */ class Mustache_Loader_ProductionFilesystemLoader extends Mustache_Loader_FilesystemLoader { + private $statProps; + + /** + * Mustache production filesystem Loader constructor. + * + * Passing an $options array allows overriding certain Loader options during instantiation: + * + * $options = array( + * // The filename extension used for Mustache templates. Defaults to '.mustache' + * 'extension' => '.ms', + * 'stat_props' => array('size', 'mtime'), + * ); + * + * Specifying 'stat_props' overrides the stat properties used to invalidate the template cache. By default, this + * uses 'mtime' and 'size', but this can be set to any of the properties supported by stat(): + * + * http://php.net/manual/en/function.stat.php + * + * You can also disable filesystem stat entirely: + * + * $options = array('stat_props' => null); + * + * But with great power comes great responsibility. Namely, if you disable stat-based cache invalidation, + * YOU MUST CLEAR THE TEMPLATE CACHE YOURSELF when your templates change. Make it part of your build or deploy + * process so you don't forget! + * + * @throws Mustache_Exception_RuntimeException if $baseDir does not exist. + * + * @param string $baseDir Base directory containing Mustache template files. + * @param array $options Array of Loader options (default: array()) + */ + public function __construct($baseDir, array $options = array()) + { + parent::__construct($baseDir, $options); + + if (array_key_exists('stat_props', $options)) { + if (empty($options['stat_props'])) { + $this->statProps = array(); + } else { + $this->statProps = $options['stat_props']; + } + } else { + $this->statProps = array('size', 'mtime'); + } + } + /** * Helper function for loading a Mustache file by name. * @@ -35,6 +81,6 @@ protected function loadFile($name) throw new Mustache_Exception_UnknownTemplateException($name); } - return new Mustache_Source_FilesystemSource($fileName); + return new Mustache_Source_FilesystemSource($fileName, $this->statProps); } } diff --git a/src/Mustache/Source/FilesystemSource.php b/src/Mustache/Source/FilesystemSource.php index c54a4061..7928ab2e 100644 --- a/src/Mustache/Source/FilesystemSource.php +++ b/src/Mustache/Source/FilesystemSource.php @@ -19,17 +19,20 @@ */ class Mustache_Source_FilesystemSource implements Mustache_Source { - private $stat; private $filename; + private $statProps; + private $stat; /** * Filesystem Source constructor. * * @param string $filename + * @param array $statProps */ - public function __construct($filename) + public function __construct($filename, array $statProps) { $this->filename = $filename; + $this->statProps = $statProps; } /** @@ -41,15 +44,25 @@ public function __construct($filename) */ public function getKey() { - if (!isset($this->stat)) { - $this->stat = stat($this->filename); - } + $chunks = array( + sprintf('filename:%s', $this->filename), + ); + + if (!empty($this->statProps)) { + if (!isset($this->stat)) { + $this->stat = stat($this->filename); + } + + if ($this->stat === false) { + throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->filename)); + } - if ($this->stat === false) { - throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->filename)); + foreach ($this->statProps as $prop) { + $chunks[] = sprintf('%s:%s', $prop, $this->stat[$prop]); + } } - return sprintf('filename:%s,size:%s,mtime:%s', $this->filename, $this->stat['size'], $this->stat['mtime']); + return implode(',', $chunks); } /** From 556b8e67b857afcec84916f6231862213e7f82ec Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 21:50:12 -0700 Subject: [PATCH 13/24] Clean up Source implementation a bit. Make it work with new template class name logic. --- src/Mustache/Engine.php | 19 +++++++++++-------- src/Mustache/Source.php | 8 ++++++++ src/Mustache/Source/FilesystemSource.php | 20 ++++++++++---------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 38c05c9b..41cb9208 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -611,12 +611,6 @@ protected function getLambdaCache() */ public function getTemplateClassName($source) { - if ($source instanceof Mustache_Source) { - $key = $source->getKey(); - } else { - $key = sprintf('source:%s', $source); - } - // For the most part, adding a new option here should do the trick. // // Pick a value here which is unique for each possible way the template @@ -625,17 +619,26 @@ public function getTemplateClassName($source) // 'default' escapes. // // Keep this list in alphabetical order :) - $options = array( + $chunks = array( 'charset' => $this->charset, 'delimiters' => $this->delimiters, 'entityFlags' => $this->entityFlags, 'escape' => isset($this->escape) ? 'custom' : 'default', + 'key' => ($source instanceof Mustache_Source) ? $source->getKey() : 'source', 'pragmas' => $this->getPragmas(), 'strictCallables' => $this->strictCallables, 'version' => self::VERSION, ); - return $this->templateClassPrefix . md5(json_encode($options) . "\n" . $key); + $key = json_encode($chunks); + + // Template Source instances have already provided their own source key. For strings, just include the whole + // source string in the md5 hash. + if (!$source instanceof Mustache_Source) { + $key .= "\n" . $source; + } + + return $this->templateClassPrefix . md5($key); } /** diff --git a/src/Mustache/Source.php b/src/Mustache/Source.php index 3eded910..e6dfdf46 100644 --- a/src/Mustache/Source.php +++ b/src/Mustache/Source.php @@ -17,6 +17,12 @@ interface Mustache_Source /** * Get the Source key (used to generate the compiled class name). * + * This must return a distinct key for each template source. For example, an + * MD5 hash of the template contents would probably do the trick. The + * ProductionFilesystemLoader uses mtime and file path. If your production + * source directory is under version control, you could use the current Git + * rev and the file path... + * * @throws RuntimeException when a source file cannot be read * * @return string @@ -26,6 +32,8 @@ public function getKey(); /** * Get the template Source. * + * @throws RuntimeException when a source file cannot be read + * * @return string */ public function getSource(); diff --git a/src/Mustache/Source/FilesystemSource.php b/src/Mustache/Source/FilesystemSource.php index 7928ab2e..1201af86 100644 --- a/src/Mustache/Source/FilesystemSource.php +++ b/src/Mustache/Source/FilesystemSource.php @@ -19,19 +19,19 @@ */ class Mustache_Source_FilesystemSource implements Mustache_Source { - private $filename; + private $fileName; private $statProps; private $stat; /** * Filesystem Source constructor. * - * @param string $filename + * @param string $fileName * @param array $statProps */ - public function __construct($filename, array $statProps) + public function __construct($fileName, array $statProps) { - $this->filename = $filename; + $this->fileName = $fileName; $this->statProps = $statProps; } @@ -45,24 +45,24 @@ public function __construct($filename, array $statProps) public function getKey() { $chunks = array( - sprintf('filename:%s', $this->filename), + 'fileName' => $this->fileName, ); if (!empty($this->statProps)) { if (!isset($this->stat)) { - $this->stat = stat($this->filename); + $this->stat = stat($this->fileName); } if ($this->stat === false) { - throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->filename)); + throw new RuntimeException(sprintf('Failed to read source file "%s".', $this->fileName)); } foreach ($this->statProps as $prop) { - $chunks[] = sprintf('%s:%s', $prop, $this->stat[$prop]); + $chunks[$prop] = $this->stat[$prop]; } } - return implode(',', $chunks); + return json_encode($chunks); } /** @@ -72,6 +72,6 @@ public function getKey() */ public function getSource() { - return file_get_contents($this->filename); + return file_get_contents($this->fileName); } } From b9f04e5d26934cf07fa819378d468b456614419a Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 22:20:51 -0700 Subject: [PATCH 14/24] Custom delimiters tweaks. * Add basic test for custom delimiters * Keep default delims backwards compatible --- src/Mustache/Engine.php | 4 ++-- test/Mustache/Test/EngineTest.php | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 41cb9208..f998eba1 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -54,7 +54,7 @@ class Mustache_Engine private $logger; private $strictCallables = false; private $pragmas = array(); - private $delimiters = '{{ }}'; + private $delimiters; // Services private $tokenizer; @@ -621,7 +621,7 @@ public function getTemplateClassName($source) // Keep this list in alphabetical order :) $chunks = array( 'charset' => $this->charset, - 'delimiters' => $this->delimiters, + 'delimiters' => $this->delimiters ? $this->delimiters : '{{ }}', 'entityFlags' => $this->entityFlags, 'escape' => isset($this->escape) ? 'custom' : 'default', 'key' => ($source instanceof Mustache_Source) ? $source->getKey() : 'source', diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index eb5a27a3..87a01a7b 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -349,6 +349,23 @@ private function getLoggedMustache($level = Mustache_Logger::ERROR) return array($name, $mustache); } + + public function testCustomDelimiters() + { + $mustache = new Mustache_Engine(array( + 'delimiters' => '[[ ]]', + 'partials' => array( + 'one' => '[[> two ]]', + 'two' => '[[ a ]]', + ), + )); + + $tpl = $mustache->loadTemplate('[[# a ]][[ b ]][[/a ]]'); + $this->assertEquals('c', $tpl->render(array('a' => true, 'b' => 'c'))); + + $tpl = $mustache->loadTemplate('[[> one ]]'); + $this->assertEquals('b', $tpl->render(array('a' => 'b'))); + } } class MustacheStub extends Mustache_Engine From 324f1db9633070f26643fb573fd075d0afdb3bdd Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 22:24:03 -0700 Subject: [PATCH 15/24] Bump copyright year. --- src/Mustache/Autoloader.php | 2 +- src/Mustache/Cache.php | 2 +- src/Mustache/Cache/AbstractCache.php | 2 +- src/Mustache/Cache/FilesystemCache.php | 2 +- src/Mustache/Cache/NoopCache.php | 2 +- src/Mustache/Compiler.php | 2 +- src/Mustache/Context.php | 2 +- src/Mustache/Engine.php | 2 +- src/Mustache/Exception.php | 2 +- src/Mustache/Exception/InvalidArgumentException.php | 2 +- src/Mustache/Exception/LogicException.php | 2 +- src/Mustache/Exception/RuntimeException.php | 2 +- src/Mustache/Exception/SyntaxException.php | 2 +- src/Mustache/Exception/UnknownFilterException.php | 2 +- src/Mustache/Exception/UnknownHelperException.php | 2 +- src/Mustache/Exception/UnknownTemplateException.php | 2 +- src/Mustache/HelperCollection.php | 2 +- src/Mustache/LambdaHelper.php | 2 +- src/Mustache/Loader.php | 2 +- src/Mustache/Loader/ArrayLoader.php | 2 +- src/Mustache/Loader/CascadingLoader.php | 2 +- src/Mustache/Loader/FilesystemLoader.php | 2 +- src/Mustache/Loader/InlineLoader.php | 2 +- src/Mustache/Loader/MutableLoader.php | 2 +- src/Mustache/Loader/ProductionFilesystemLoader.php | 2 +- src/Mustache/Loader/StringLoader.php | 2 +- src/Mustache/Logger.php | 2 +- src/Mustache/Logger/AbstractLogger.php | 2 +- src/Mustache/Logger/StreamLogger.php | 2 +- src/Mustache/Parser.php | 2 +- src/Mustache/Source.php | 2 +- src/Mustache/Source/FilesystemSource.php | 2 +- src/Mustache/Template.php | 2 +- src/Mustache/Tokenizer.php | 2 +- test/Mustache/Test/AutoloaderTest.php | 2 +- test/Mustache/Test/Cache/AbstractCacheTest.php | 2 +- test/Mustache/Test/Cache/FilesystemCacheTest.php | 2 +- test/Mustache/Test/CompilerTest.php | 2 +- test/Mustache/Test/ContextTest.php | 2 +- test/Mustache/Test/EngineTest.php | 2 +- test/Mustache/Test/Exception/SyntaxExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownFilterExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownHelperExceptionTest.php | 2 +- test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/EngineTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/FiltersTest.php | 2 +- .../Test/FiveThree/Functional/HigherOrderSectionsTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php | 2 +- .../Test/FiveThree/Functional/PartialLambdaIndentTest.php | 2 +- test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php | 2 +- test/Mustache/Test/Functional/CallTest.php | 2 +- test/Mustache/Test/Functional/ExamplesTest.php | 2 +- test/Mustache/Test/Functional/HigherOrderSectionsTest.php | 2 +- test/Mustache/Test/Functional/InheritanceTest.php | 2 +- test/Mustache/Test/Functional/MustacheInjectionTest.php | 2 +- test/Mustache/Test/Functional/MustacheSpecTest.php | 2 +- test/Mustache/Test/Functional/NestedPartialIndentTest.php | 2 +- test/Mustache/Test/Functional/ObjectSectionTest.php | 2 +- test/Mustache/Test/FunctionalTestCase.php | 2 +- test/Mustache/Test/HelperCollectionTest.php | 2 +- test/Mustache/Test/Loader/ArrayLoaderTest.php | 2 +- test/Mustache/Test/Loader/CascadingLoaderTest.php | 2 +- test/Mustache/Test/Loader/FilesystemLoaderTest.php | 2 +- test/Mustache/Test/Loader/InlineLoaderTest.php | 2 +- test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php | 2 +- test/Mustache/Test/Loader/StringLoaderTest.php | 2 +- test/Mustache/Test/Logger/AbstractLoggerTest.php | 2 +- test/Mustache/Test/Logger/StreamLoggerTest.php | 2 +- test/Mustache/Test/ParserTest.php | 2 +- test/Mustache/Test/SpecTestCase.php | 2 +- test/Mustache/Test/TemplateTest.php | 2 +- test/Mustache/Test/TokenizerTest.php | 2 +- test/bootstrap.php | 2 +- test/fixtures/autoloader/Mustache/Bar.php | 2 +- test/fixtures/autoloader/Mustache/Foo.php | 2 +- test/fixtures/autoloader/NonMustacheClass.php | 2 +- test/fixtures/examples/blocks/Blocks.php | 2 +- test/fixtures/examples/child_context/ChildContext.php | 2 +- test/fixtures/examples/comments/Comments.php | 2 +- test/fixtures/examples/complex/complex.php | 2 +- test/fixtures/examples/delimiters/Delimiters.php | 2 +- test/fixtures/examples/dot_notation/DotNotation.php | 2 +- test/fixtures/examples/double_section/DoubleSection.php | 2 +- test/fixtures/examples/escaped/Escaped.php | 2 +- test/fixtures/examples/filters/Filters.php | 2 +- .../examples/grand_parent_context/GrandParentContext.php | 2 +- test/fixtures/examples/i18n/I18n.php | 2 +- test/fixtures/examples/implicit_iterator/ImplicitIterator.php | 2 +- .../examples/inverted_double_section/InvertedDoubleSection.php | 2 +- test/fixtures/examples/inverted_section/InvertedSection.php | 2 +- test/fixtures/examples/nested_partials/NestedPartials.php | 2 +- test/fixtures/examples/partials/Partials.php | 2 +- test/fixtures/examples/recursive_partials/RecursivePartials.php | 2 +- .../section_iterator_objects/SectionIteratorObjects.php | 2 +- .../examples/section_magic_objects/SectionMagicObjects.php | 2 +- test/fixtures/examples/section_objects/SectionObjects.php | 2 +- test/fixtures/examples/sections/Sections.php | 2 +- test/fixtures/examples/sections_nested/SectionsNested.php | 2 +- test/fixtures/examples/simple/Simple.php | 2 +- test/fixtures/examples/unescaped/Unescaped.php | 2 +- test/fixtures/examples/utf8/UTF8.php | 2 +- test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php | 2 +- test/fixtures/examples/whitespace/Whitespace.php | 2 +- 105 files changed, 105 insertions(+), 105 deletions(-) diff --git a/src/Mustache/Autoloader.php b/src/Mustache/Autoloader.php index 3fdadd2e..e8ea3f4a 100644 --- a/src/Mustache/Autoloader.php +++ b/src/Mustache/Autoloader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache.php b/src/Mustache/Cache.php index 7b465abd..3b5b3f1b 100644 --- a/src/Mustache/Cache.php +++ b/src/Mustache/Cache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/AbstractCache.php b/src/Mustache/Cache/AbstractCache.php index 495090b6..365eafac 100644 --- a/src/Mustache/Cache/AbstractCache.php +++ b/src/Mustache/Cache/AbstractCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/FilesystemCache.php b/src/Mustache/Cache/FilesystemCache.php index 0dbe8f9d..530bd63d 100644 --- a/src/Mustache/Cache/FilesystemCache.php +++ b/src/Mustache/Cache/FilesystemCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Cache/NoopCache.php b/src/Mustache/Cache/NoopCache.php index ca0007de..ed9eec9d 100644 --- a/src/Mustache/Cache/NoopCache.php +++ b/src/Mustache/Cache/NoopCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 34c39583..64c58d25 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Context.php b/src/Mustache/Context.php index f59faea8..69c02e01 100644 --- a/src/Mustache/Context.php +++ b/src/Mustache/Context.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index f998eba1..9227cadd 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception.php b/src/Mustache/Exception.php index 66bd6bd4..d4001a9b 100644 --- a/src/Mustache/Exception.php +++ b/src/Mustache/Exception.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/InvalidArgumentException.php b/src/Mustache/Exception/InvalidArgumentException.php index 46b200c6..becf2ed1 100644 --- a/src/Mustache/Exception/InvalidArgumentException.php +++ b/src/Mustache/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/LogicException.php b/src/Mustache/Exception/LogicException.php index 8e75e7e1..b2424d67 100644 --- a/src/Mustache/Exception/LogicException.php +++ b/src/Mustache/Exception/LogicException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/RuntimeException.php b/src/Mustache/Exception/RuntimeException.php index 9a7b90b5..b6369f4b 100644 --- a/src/Mustache/Exception/RuntimeException.php +++ b/src/Mustache/Exception/RuntimeException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/SyntaxException.php b/src/Mustache/Exception/SyntaxException.php index 4fcb39d7..bfc16cfb 100644 --- a/src/Mustache/Exception/SyntaxException.php +++ b/src/Mustache/Exception/SyntaxException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownFilterException.php b/src/Mustache/Exception/UnknownFilterException.php index 44505e49..9449f989 100644 --- a/src/Mustache/Exception/UnknownFilterException.php +++ b/src/Mustache/Exception/UnknownFilterException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownHelperException.php b/src/Mustache/Exception/UnknownHelperException.php index e1bc4d2c..ce75e5a3 100644 --- a/src/Mustache/Exception/UnknownHelperException.php +++ b/src/Mustache/Exception/UnknownHelperException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Exception/UnknownTemplateException.php b/src/Mustache/Exception/UnknownTemplateException.php index 0c377962..79a3ea5f 100644 --- a/src/Mustache/Exception/UnknownTemplateException.php +++ b/src/Mustache/Exception/UnknownTemplateException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/HelperCollection.php b/src/Mustache/HelperCollection.php index 86c56b78..5d8f73c1 100644 --- a/src/Mustache/HelperCollection.php +++ b/src/Mustache/HelperCollection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/LambdaHelper.php b/src/Mustache/LambdaHelper.php index 1d203d5d..e93dbfa3 100644 --- a/src/Mustache/LambdaHelper.php +++ b/src/Mustache/LambdaHelper.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader.php b/src/Mustache/Loader.php index b8be775e..23adba1a 100644 --- a/src/Mustache/Loader.php +++ b/src/Mustache/Loader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/ArrayLoader.php b/src/Mustache/Loader/ArrayLoader.php index c0d6a4d4..4276493a 100644 --- a/src/Mustache/Loader/ArrayLoader.php +++ b/src/Mustache/Loader/ArrayLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/CascadingLoader.php b/src/Mustache/Loader/CascadingLoader.php index b4726bc7..3fb6353c 100644 --- a/src/Mustache/Loader/CascadingLoader.php +++ b/src/Mustache/Loader/CascadingLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/FilesystemLoader.php b/src/Mustache/Loader/FilesystemLoader.php index a3137513..e366df70 100644 --- a/src/Mustache/Loader/FilesystemLoader.php +++ b/src/Mustache/Loader/FilesystemLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/InlineLoader.php b/src/Mustache/Loader/InlineLoader.php index f6d4b179..ae297fec 100644 --- a/src/Mustache/Loader/InlineLoader.php +++ b/src/Mustache/Loader/InlineLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/MutableLoader.php b/src/Mustache/Loader/MutableLoader.php index f228d907..57fe5be3 100644 --- a/src/Mustache/Loader/MutableLoader.php +++ b/src/Mustache/Loader/MutableLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/ProductionFilesystemLoader.php b/src/Mustache/Loader/ProductionFilesystemLoader.php index 85428f05..e7353327 100644 --- a/src/Mustache/Loader/ProductionFilesystemLoader.php +++ b/src/Mustache/Loader/ProductionFilesystemLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Loader/StringLoader.php b/src/Mustache/Loader/StringLoader.php index 79b616bf..7012c03b 100644 --- a/src/Mustache/Loader/StringLoader.php +++ b/src/Mustache/Loader/StringLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger.php b/src/Mustache/Logger.php index 324a7ce5..cb4037a2 100644 --- a/src/Mustache/Logger.php +++ b/src/Mustache/Logger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger/AbstractLogger.php b/src/Mustache/Logger/AbstractLogger.php index 64bdf663..a169f9c6 100644 --- a/src/Mustache/Logger/AbstractLogger.php +++ b/src/Mustache/Logger/AbstractLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Logger/StreamLogger.php b/src/Mustache/Logger/StreamLogger.php index efb32318..402a148e 100644 --- a/src/Mustache/Logger/StreamLogger.php +++ b/src/Mustache/Logger/StreamLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Parser.php b/src/Mustache/Parser.php index adefebdd..c36a84af 100644 --- a/src/Mustache/Parser.php +++ b/src/Mustache/Parser.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Source.php b/src/Mustache/Source.php index e6dfdf46..278c2cb3 100644 --- a/src/Mustache/Source.php +++ b/src/Mustache/Source.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Source/FilesystemSource.php b/src/Mustache/Source/FilesystemSource.php index 1201af86..b09f46eb 100644 --- a/src/Mustache/Source/FilesystemSource.php +++ b/src/Mustache/Source/FilesystemSource.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Template.php b/src/Mustache/Template.php index 2b7771c4..4de82393 100644 --- a/src/Mustache/Template.php +++ b/src/Mustache/Template.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index 27e4d05e..f9e5d508 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/AutoloaderTest.php b/test/Mustache/Test/AutoloaderTest.php index f7a1ccff..c72effef 100644 --- a/test/Mustache/Test/AutoloaderTest.php +++ b/test/Mustache/Test/AutoloaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Cache/AbstractCacheTest.php b/test/Mustache/Test/Cache/AbstractCacheTest.php index d977388b..ac47e64f 100644 --- a/test/Mustache/Test/Cache/AbstractCacheTest.php +++ b/test/Mustache/Test/Cache/AbstractCacheTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Cache/FilesystemCacheTest.php b/test/Mustache/Test/Cache/FilesystemCacheTest.php index 2413125c..6bcc483d 100644 --- a/test/Mustache/Test/Cache/FilesystemCacheTest.php +++ b/test/Mustache/Test/Cache/FilesystemCacheTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/CompilerTest.php b/test/Mustache/Test/CompilerTest.php index 725a82c2..6fd1986f 100644 --- a/test/Mustache/Test/CompilerTest.php +++ b/test/Mustache/Test/CompilerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/ContextTest.php b/test/Mustache/Test/ContextTest.php index 029c2ba8..447ea161 100644 --- a/test/Mustache/Test/ContextTest.php +++ b/test/Mustache/Test/ContextTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index 87a01a7b..ed067326 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/SyntaxExceptionTest.php b/test/Mustache/Test/Exception/SyntaxExceptionTest.php index 3f6b2e45..074dafcd 100644 --- a/test/Mustache/Test/Exception/SyntaxExceptionTest.php +++ b/test/Mustache/Test/Exception/SyntaxExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php b/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php index 049c8426..6dbe25e3 100644 --- a/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php b/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php index b1682cdc..5b1ccbb6 100644 --- a/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownHelperExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php b/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php index 2452749b..b993bfa8 100644 --- a/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php +++ b/test/Mustache/Test/Exception/UnknownTemplateExceptionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php b/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php index c997a1d2..cc575a9d 100644 --- a/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php +++ b/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/EngineTest.php b/test/Mustache/Test/FiveThree/Functional/EngineTest.php index 3ed70c76..406473eb 100644 --- a/test/Mustache/Test/FiveThree/Functional/EngineTest.php +++ b/test/Mustache/Test/FiveThree/Functional/EngineTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/FiltersTest.php b/test/Mustache/Test/FiveThree/Functional/FiltersTest.php index 7adc6638..16dec608 100644 --- a/test/Mustache/Test/FiveThree/Functional/FiltersTest.php +++ b/test/Mustache/Test/FiveThree/Functional/FiltersTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php index f926fdf7..eb051504 100644 --- a/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php +++ b/test/Mustache/Test/FiveThree/Functional/HigherOrderSectionsTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php b/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php index c67957e4..6fc5d400 100644 --- a/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php +++ b/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php index d72686d5..af3f982b 100644 --- a/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php +++ b/test/Mustache/Test/FiveThree/Functional/MustacheSpecTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php index 605003c2..1f9af7ca 100644 --- a/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php +++ b/test/Mustache/Test/FiveThree/Functional/PartialLambdaIndentTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php b/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php index fc910727..2c01169e 100644 --- a/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php +++ b/test/Mustache/Test/FiveThree/Functional/StrictCallablesTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/CallTest.php b/test/Mustache/Test/Functional/CallTest.php index fddeacf2..681ec1bc 100644 --- a/test/Mustache/Test/Functional/CallTest.php +++ b/test/Mustache/Test/Functional/CallTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/ExamplesTest.php b/test/Mustache/Test/Functional/ExamplesTest.php index d7ef51ac..ac883ea4 100644 --- a/test/Mustache/Test/Functional/ExamplesTest.php +++ b/test/Mustache/Test/Functional/ExamplesTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/HigherOrderSectionsTest.php b/test/Mustache/Test/Functional/HigherOrderSectionsTest.php index e2f68b0b..14774cd2 100644 --- a/test/Mustache/Test/Functional/HigherOrderSectionsTest.php +++ b/test/Mustache/Test/Functional/HigherOrderSectionsTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/InheritanceTest.php b/test/Mustache/Test/Functional/InheritanceTest.php index 598d959a..62437041 100644 --- a/test/Mustache/Test/Functional/InheritanceTest.php +++ b/test/Mustache/Test/Functional/InheritanceTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/MustacheInjectionTest.php b/test/Mustache/Test/Functional/MustacheInjectionTest.php index d0bdb487..7a9d6acd 100644 --- a/test/Mustache/Test/Functional/MustacheInjectionTest.php +++ b/test/Mustache/Test/Functional/MustacheInjectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/MustacheSpecTest.php b/test/Mustache/Test/Functional/MustacheSpecTest.php index 7ba0843e..6cde602e 100644 --- a/test/Mustache/Test/Functional/MustacheSpecTest.php +++ b/test/Mustache/Test/Functional/MustacheSpecTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/NestedPartialIndentTest.php b/test/Mustache/Test/Functional/NestedPartialIndentTest.php index 673339c3..90af4d95 100644 --- a/test/Mustache/Test/Functional/NestedPartialIndentTest.php +++ b/test/Mustache/Test/Functional/NestedPartialIndentTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Functional/ObjectSectionTest.php b/test/Mustache/Test/Functional/ObjectSectionTest.php index 963b0f78..3cf01e18 100644 --- a/test/Mustache/Test/Functional/ObjectSectionTest.php +++ b/test/Mustache/Test/Functional/ObjectSectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/FunctionalTestCase.php b/test/Mustache/Test/FunctionalTestCase.php index 59185d18..213b045e 100644 --- a/test/Mustache/Test/FunctionalTestCase.php +++ b/test/Mustache/Test/FunctionalTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/HelperCollectionTest.php b/test/Mustache/Test/HelperCollectionTest.php index df64e97d..12dfb5cf 100644 --- a/test/Mustache/Test/HelperCollectionTest.php +++ b/test/Mustache/Test/HelperCollectionTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/ArrayLoaderTest.php b/test/Mustache/Test/Loader/ArrayLoaderTest.php index 9960c9b7..1f309878 100644 --- a/test/Mustache/Test/Loader/ArrayLoaderTest.php +++ b/test/Mustache/Test/Loader/ArrayLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/CascadingLoaderTest.php b/test/Mustache/Test/Loader/CascadingLoaderTest.php index 6d97d8d9..ecf80d6f 100644 --- a/test/Mustache/Test/Loader/CascadingLoaderTest.php +++ b/test/Mustache/Test/Loader/CascadingLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/FilesystemLoaderTest.php b/test/Mustache/Test/Loader/FilesystemLoaderTest.php index 75880d40..8c06e76b 100644 --- a/test/Mustache/Test/Loader/FilesystemLoaderTest.php +++ b/test/Mustache/Test/Loader/FilesystemLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/InlineLoaderTest.php b/test/Mustache/Test/Loader/InlineLoaderTest.php index 2f1d4140..24f2e0b3 100644 --- a/test/Mustache/Test/Loader/InlineLoaderTest.php +++ b/test/Mustache/Test/Loader/InlineLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php index 300b6e84..afdb09ec 100644 --- a/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php +++ b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Loader/StringLoaderTest.php b/test/Mustache/Test/Loader/StringLoaderTest.php index f2e47d93..5896f00b 100644 --- a/test/Mustache/Test/Loader/StringLoaderTest.php +++ b/test/Mustache/Test/Loader/StringLoaderTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Logger/AbstractLoggerTest.php b/test/Mustache/Test/Logger/AbstractLoggerTest.php index e8865e94..19dc27cd 100644 --- a/test/Mustache/Test/Logger/AbstractLoggerTest.php +++ b/test/Mustache/Test/Logger/AbstractLoggerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/Logger/StreamLoggerTest.php b/test/Mustache/Test/Logger/StreamLoggerTest.php index 6cb198a8..fc1a06f1 100644 --- a/test/Mustache/Test/Logger/StreamLoggerTest.php +++ b/test/Mustache/Test/Logger/StreamLoggerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/ParserTest.php b/test/Mustache/Test/ParserTest.php index 85e5701a..d8458f76 100644 --- a/test/Mustache/Test/ParserTest.php +++ b/test/Mustache/Test/ParserTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/SpecTestCase.php b/test/Mustache/Test/SpecTestCase.php index 9fb4a15e..db188dea 100644 --- a/test/Mustache/Test/SpecTestCase.php +++ b/test/Mustache/Test/SpecTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/TemplateTest.php b/test/Mustache/Test/TemplateTest.php index bb260d2e..60065aad 100644 --- a/test/Mustache/Test/TemplateTest.php +++ b/test/Mustache/Test/TemplateTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/Mustache/Test/TokenizerTest.php b/test/Mustache/Test/TokenizerTest.php index 09be3fe5..38f16dc4 100644 --- a/test/Mustache/Test/TokenizerTest.php +++ b/test/Mustache/Test/TokenizerTest.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/bootstrap.php b/test/bootstrap.php index 21fc6896..b3d0a199 100644 --- a/test/bootstrap.php +++ b/test/bootstrap.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/Mustache/Bar.php b/test/fixtures/autoloader/Mustache/Bar.php index 80927224..35c2668b 100644 --- a/test/fixtures/autoloader/Mustache/Bar.php +++ b/test/fixtures/autoloader/Mustache/Bar.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/Mustache/Foo.php b/test/fixtures/autoloader/Mustache/Foo.php index 7e6ef3ab..45837eee 100644 --- a/test/fixtures/autoloader/Mustache/Foo.php +++ b/test/fixtures/autoloader/Mustache/Foo.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/autoloader/NonMustacheClass.php b/test/fixtures/autoloader/NonMustacheClass.php index d8d59294..be6153b7 100644 --- a/test/fixtures/autoloader/NonMustacheClass.php +++ b/test/fixtures/autoloader/NonMustacheClass.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/blocks/Blocks.php b/test/fixtures/examples/blocks/Blocks.php index 2a7cb206..6362aca2 100644 --- a/test/fixtures/examples/blocks/Blocks.php +++ b/test/fixtures/examples/blocks/Blocks.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/child_context/ChildContext.php b/test/fixtures/examples/child_context/ChildContext.php index 9ef84ae5..d898e5b3 100644 --- a/test/fixtures/examples/child_context/ChildContext.php +++ b/test/fixtures/examples/child_context/ChildContext.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/comments/Comments.php b/test/fixtures/examples/comments/Comments.php index 690d139e..88fe821a 100644 --- a/test/fixtures/examples/comments/Comments.php +++ b/test/fixtures/examples/comments/Comments.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/complex/complex.php b/test/fixtures/examples/complex/complex.php index ebb27332..7c696153 100644 --- a/test/fixtures/examples/complex/complex.php +++ b/test/fixtures/examples/complex/complex.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/delimiters/Delimiters.php b/test/fixtures/examples/delimiters/Delimiters.php index e3b044d2..235a0886 100644 --- a/test/fixtures/examples/delimiters/Delimiters.php +++ b/test/fixtures/examples/delimiters/Delimiters.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/dot_notation/DotNotation.php b/test/fixtures/examples/dot_notation/DotNotation.php index d4003185..eadbf61d 100644 --- a/test/fixtures/examples/dot_notation/DotNotation.php +++ b/test/fixtures/examples/dot_notation/DotNotation.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/double_section/DoubleSection.php b/test/fixtures/examples/double_section/DoubleSection.php index 6989d95a..1b3f6b66 100644 --- a/test/fixtures/examples/double_section/DoubleSection.php +++ b/test/fixtures/examples/double_section/DoubleSection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/escaped/Escaped.php b/test/fixtures/examples/escaped/Escaped.php index 2e5805be..f2510c60 100644 --- a/test/fixtures/examples/escaped/Escaped.php +++ b/test/fixtures/examples/escaped/Escaped.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/filters/Filters.php b/test/fixtures/examples/filters/Filters.php index fb7c3f51..eb6e3b77 100644 --- a/test/fixtures/examples/filters/Filters.php +++ b/test/fixtures/examples/filters/Filters.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/grand_parent_context/GrandParentContext.php b/test/fixtures/examples/grand_parent_context/GrandParentContext.php index e3ea25f3..2ee0e428 100644 --- a/test/fixtures/examples/grand_parent_context/GrandParentContext.php +++ b/test/fixtures/examples/grand_parent_context/GrandParentContext.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/i18n/I18n.php b/test/fixtures/examples/i18n/I18n.php index 77dc7b25..c36bf709 100644 --- a/test/fixtures/examples/i18n/I18n.php +++ b/test/fixtures/examples/i18n/I18n.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/implicit_iterator/ImplicitIterator.php b/test/fixtures/examples/implicit_iterator/ImplicitIterator.php index 6a264773..074f8f49 100644 --- a/test/fixtures/examples/implicit_iterator/ImplicitIterator.php +++ b/test/fixtures/examples/implicit_iterator/ImplicitIterator.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php b/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php index 79466409..32bc6cf6 100644 --- a/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php +++ b/test/fixtures/examples/inverted_double_section/InvertedDoubleSection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/inverted_section/InvertedSection.php b/test/fixtures/examples/inverted_section/InvertedSection.php index a4ab8d5c..5defa9ed 100644 --- a/test/fixtures/examples/inverted_section/InvertedSection.php +++ b/test/fixtures/examples/inverted_section/InvertedSection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/nested_partials/NestedPartials.php b/test/fixtures/examples/nested_partials/NestedPartials.php index 1a5afd34..a2a2bb16 100644 --- a/test/fixtures/examples/nested_partials/NestedPartials.php +++ b/test/fixtures/examples/nested_partials/NestedPartials.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/partials/Partials.php b/test/fixtures/examples/partials/Partials.php index 1bdaaa19..e91dc681 100644 --- a/test/fixtures/examples/partials/Partials.php +++ b/test/fixtures/examples/partials/Partials.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/recursive_partials/RecursivePartials.php b/test/fixtures/examples/recursive_partials/RecursivePartials.php index 25d15fd6..15b6973d 100644 --- a/test/fixtures/examples/recursive_partials/RecursivePartials.php +++ b/test/fixtures/examples/recursive_partials/RecursivePartials.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php b/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php index 77e083eb..0dc793c2 100644 --- a/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php +++ b/test/fixtures/examples/section_iterator_objects/SectionIteratorObjects.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php b/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php index 54288d65..0fcb3b4b 100644 --- a/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php +++ b/test/fixtures/examples/section_magic_objects/SectionMagicObjects.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/section_objects/SectionObjects.php b/test/fixtures/examples/section_objects/SectionObjects.php index b977ec58..913c3ebd 100644 --- a/test/fixtures/examples/section_objects/SectionObjects.php +++ b/test/fixtures/examples/section_objects/SectionObjects.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/sections/Sections.php b/test/fixtures/examples/sections/Sections.php index 86bc893c..cf918c12 100644 --- a/test/fixtures/examples/sections/Sections.php +++ b/test/fixtures/examples/sections/Sections.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/sections_nested/SectionsNested.php b/test/fixtures/examples/sections_nested/SectionsNested.php index dccc0d94..43657c3d 100644 --- a/test/fixtures/examples/sections_nested/SectionsNested.php +++ b/test/fixtures/examples/sections_nested/SectionsNested.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/simple/Simple.php b/test/fixtures/examples/simple/Simple.php index 570af22b..a5492e8f 100644 --- a/test/fixtures/examples/simple/Simple.php +++ b/test/fixtures/examples/simple/Simple.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/unescaped/Unescaped.php b/test/fixtures/examples/unescaped/Unescaped.php index abe91787..ea85f885 100644 --- a/test/fixtures/examples/unescaped/Unescaped.php +++ b/test/fixtures/examples/unescaped/Unescaped.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/utf8/UTF8.php b/test/fixtures/examples/utf8/UTF8.php index 8c149411..c53fec9f 100644 --- a/test/fixtures/examples/utf8/UTF8.php +++ b/test/fixtures/examples/utf8/UTF8.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php b/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php index 43096754..67f93666 100644 --- a/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php +++ b/test/fixtures/examples/utf8_unescaped/UTF8Unescaped.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/test/fixtures/examples/whitespace/Whitespace.php b/test/fixtures/examples/whitespace/Whitespace.php index d5a5c620..57a3267f 100644 --- a/test/fixtures/examples/whitespace/Whitespace.php +++ b/test/fixtures/examples/whitespace/Whitespace.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2016 Justin Hileman + * (c) 2010-2017 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From 2b76cbeb667472e403042c42dd956eb89603ab70 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 22:55:12 -0700 Subject: [PATCH 16/24] Remove unused internal compiler arg. We stopped passing it in 11ad87ae but missed the cleanup. --- src/Mustache/Compiler.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 64c58d25..944d7055 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -365,11 +365,10 @@ private function section%s(Mustache_Context $context, $indent, $value) * @param string $otag Current Mustache opening tag * @param string $ctag Current Mustache closing tag * @param int $level - * @param bool $arg (default: false) * * @return string Generated section PHP source code */ - private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level, $arg = false) + private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $level) { $source = var_export(substr($this->source, $start, $end - $start), true); $callable = $this->getCallable(); @@ -389,15 +388,11 @@ private function section($nodes, $id, $filters, $start, $end, $otag, $ctag, $lev $this->sections[$key] = sprintf($this->prepare(self::SECTION), $key, $callable, $source, $helper, $delims, $this->walk($nodes, 2)); } - if ($arg === true) { - return $key; - } else { - $method = $this->getFindMethod($id); - $id = var_export($id, true); - $filters = $this->getFilters($filters, $level); + $method = $this->getFindMethod($id); + $id = var_export($id, true); + $filters = $this->getFilters($filters, $level); - return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key); - } + return sprintf($this->prepare(self::SECTION_CALL, $level), $id, $method, $id, $filters, $key); } const INVERTED_SECTION = ' From 14ff48584ab77916bd23b101e51f99714eeb8d76 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 2 Jul 2017 23:50:42 -0700 Subject: [PATCH 17/24] Add an example for anchored dot notation. --- .../AnchoredDotNotation.php | 55 +++++++++++++++++++ .../anchored_dot_notation.mustache | 4 ++ .../anchored_dot_notation.txt | 11 ++++ .../partials/genre.mustache | 5 ++ 4 files changed, 75 insertions(+) create mode 100644 test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php create mode 100644 test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache create mode 100644 test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt create mode 100644 test/fixtures/examples/anchored_dot_notation/partials/genre.mustache diff --git a/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php new file mode 100644 index 00000000..ee760596 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php @@ -0,0 +1,55 @@ + 'Punk', + 'subgenres' => array( + array( + 'name' => 'Hardcore', + 'subgenres' => array( + array( + 'name' => 'First wave of black metal', + 'subgenres' => array( + array('name' => 'Norwegian black metal'), + array( + 'name' => 'Death metal', + 'subgenres' => array( + array( + 'name' => 'Swedish death metal', + 'subgenres' => array( + array('name' => 'New wave of American metal'), + ), + ), + ), + ), + ), + ), + array( + 'name' => 'Thrash metal', + 'subgenres' => array( + array('name' => 'Grindcore'), + array( + 'name' => 'Metalcore', + 'subgenres' => array( + array('name' => 'Nu metal'), + ), + ), + ), + ), + ), + ), + ), + ), + ); +} diff --git a/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache new file mode 100644 index 00000000..9494fb10 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.mustache @@ -0,0 +1,4 @@ +{{% ANCHORED-DOT }} +{{# genres }} +{{> genre }} +{{/ genres }} \ No newline at end of file diff --git a/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt new file mode 100644 index 00000000..fa56efc9 --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/anchored_dot_notation.txt @@ -0,0 +1,11 @@ + - Punk + - Hardcore + - First wave of black metal + - Norwegian black metal + - Death metal + - Swedish death metal + - New wave of American metal + - Thrash metal + - Grindcore + - Metalcore + - Nu metal diff --git a/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache b/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache new file mode 100644 index 00000000..f51c503b --- /dev/null +++ b/test/fixtures/examples/anchored_dot_notation/partials/genre.mustache @@ -0,0 +1,5 @@ +{{% ANCHORED-DOT }} + - {{ name }} +{{# .subgenres }} + {{> genre }} +{{/ .subgenres }} \ No newline at end of file From 6a527de467311833ad7300a0ee231bd80cc95256 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:16:08 -0700 Subject: [PATCH 18/24] Mark a few things we can't really get code coverage for. --- src/Mustache/Cache/FilesystemCache.php | 6 ++++++ src/Mustache/Exception/SyntaxException.php | 2 +- src/Mustache/Exception/UnknownFilterException.php | 2 +- src/Mustache/Exception/UnknownHelperException.php | 2 +- src/Mustache/Exception/UnknownTemplateException.php | 2 +- src/Mustache/Tokenizer.php | 5 +++++ 6 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Mustache/Cache/FilesystemCache.php b/src/Mustache/Cache/FilesystemCache.php index 530bd63d..3e742b70 100644 --- a/src/Mustache/Cache/FilesystemCache.php +++ b/src/Mustache/Cache/FilesystemCache.php @@ -108,9 +108,11 @@ private function buildDirectoryForFilename($fileName) ); @mkdir($dirName, 0777, true); + // @codeCoverageIgnoreStart if (!is_dir($dirName)) { throw new Mustache_Exception_RuntimeException(sprintf('Failed to create cache directory "%s".', $dirName)); } + // @codeCoverageIgnoreEnd } return $dirName; @@ -143,13 +145,17 @@ private function writeFile($fileName, $value) return; } + // @codeCoverageIgnoreStart $this->log( Mustache_Logger::ERROR, 'Unable to rename Mustache temp cache file: "{tempName}" -> "{fileName}"', array('tempName' => $tempFile, 'fileName' => $fileName) ); + // @codeCoverageIgnoreEnd } + // @codeCoverageIgnoreStart throw new Mustache_Exception_RuntimeException(sprintf('Failed to write cache file "%s".', $fileName)); + // @codeCoverageIgnoreEnd } } diff --git a/src/Mustache/Exception/SyntaxException.php b/src/Mustache/Exception/SyntaxException.php index bfc16cfb..b1879a3d 100644 --- a/src/Mustache/Exception/SyntaxException.php +++ b/src/Mustache/Exception/SyntaxException.php @@ -27,7 +27,7 @@ public function __construct($msg, array $token, Exception $previous = null) if (version_compare(PHP_VERSION, '5.3.0', '>=')) { parent::__construct($msg, 0, $previous); } else { - parent::__construct($msg); + parent::__construct($msg); // @codeCoverageIgnore } } diff --git a/src/Mustache/Exception/UnknownFilterException.php b/src/Mustache/Exception/UnknownFilterException.php index 9449f989..0651c173 100644 --- a/src/Mustache/Exception/UnknownFilterException.php +++ b/src/Mustache/Exception/UnknownFilterException.php @@ -27,7 +27,7 @@ public function __construct($filterName, Exception $previous = null) if (version_compare(PHP_VERSION, '5.3.0', '>=')) { parent::__construct($message, 0, $previous); } else { - parent::__construct($message); + parent::__construct($message); // @codeCoverageIgnore } } diff --git a/src/Mustache/Exception/UnknownHelperException.php b/src/Mustache/Exception/UnknownHelperException.php index ce75e5a3..193be782 100644 --- a/src/Mustache/Exception/UnknownHelperException.php +++ b/src/Mustache/Exception/UnknownHelperException.php @@ -27,7 +27,7 @@ public function __construct($helperName, Exception $previous = null) if (version_compare(PHP_VERSION, '5.3.0', '>=')) { parent::__construct($message, 0, $previous); } else { - parent::__construct($message); + parent::__construct($message); // @codeCoverageIgnore } } diff --git a/src/Mustache/Exception/UnknownTemplateException.php b/src/Mustache/Exception/UnknownTemplateException.php index 79a3ea5f..32a778a5 100644 --- a/src/Mustache/Exception/UnknownTemplateException.php +++ b/src/Mustache/Exception/UnknownTemplateException.php @@ -27,7 +27,7 @@ public function __construct($templateName, Exception $previous = null) if (version_compare(PHP_VERSION, '5.3.0', '>=')) { parent::__construct($message, 0, $previous); } else { - parent::__construct($message); + parent::__construct($message); // @codeCoverageIgnore } } diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index f9e5d508..b1f3d738 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -91,11 +91,14 @@ public function scan($text, $delimiters = null) { // Setting mbstring.func_overload makes things *really* slow. // Let's do everyone a favor and scan this string as ASCII instead. + // + // @codeCoverageIgnoreStart $encoding = null; if (function_exists('mb_internal_encoding') && ini_get('mbstring.func_overload') & 2) { $encoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } + // @codeCoverageIgnoreEnd $this->reset(); @@ -202,9 +205,11 @@ public function scan($text, $delimiters = null) $this->flushBuffer(); // Restore the user's encoding... + // @codeCoverageIgnoreStart if ($encoding) { mb_internal_encoding($encoding); } + // @codeCoverageIgnoreEnd return $this->tokens; } From 89987ac89076f3a8f08863d558b94be2f8da211f Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:16:21 -0700 Subject: [PATCH 19/24] Fix a comment that had become a lie. --- src/Mustache/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mustache/Compiler.php b/src/Mustache/Compiler.php index 944d7055..610369ed 100644 --- a/src/Mustache/Compiler.php +++ b/src/Mustache/Compiler.php @@ -626,7 +626,7 @@ private function getEscape($value = '$value') /** * Select the appropriate Context `find` method for a given $id. * - * The return value will be one of `find`, `findDot` or `last`. + * The return value will be one of `find`, `findDot`, `findAnchoredDot` or `last`. * * @see Mustache_Context::find * @see Mustache_Context::findDot From 7434e97df5662d0c9c5d02ec679ca9e7169798e0 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:16:38 -0700 Subject: [PATCH 20/24] Swallow errors on `stat` in FilesystemSource. --- src/Mustache/Source/FilesystemSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mustache/Source/FilesystemSource.php b/src/Mustache/Source/FilesystemSource.php index b09f46eb..1284ac72 100644 --- a/src/Mustache/Source/FilesystemSource.php +++ b/src/Mustache/Source/FilesystemSource.php @@ -50,7 +50,7 @@ public function getKey() if (!empty($this->statProps)) { if (!isset($this->stat)) { - $this->stat = stat($this->fileName); + $this->stat = @stat($this->fileName); } if ($this->stat === false) { From 933554098a6fe5fcb233f4c9716b074ba410f6a9 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:17:05 -0700 Subject: [PATCH 21/24] Improve prod filesystem loader test coverage. --- .../Loader/ProductionFilesystemLoaderTest.php | 21 ++++++++++++++++ .../Test/Source/FilesystemSourceTest.php | 25 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 test/Mustache/Test/Source/FilesystemSourceTest.php diff --git a/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php index afdb09ec..0c7c7e30 100644 --- a/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php +++ b/test/Mustache/Test/Loader/ProductionFilesystemLoaderTest.php @@ -79,4 +79,25 @@ public function testMissingTemplateThrowsException() $loader->load('fake'); } + + public function testLoadWithDifferentStatProps() + { + $baseDir = realpath(dirname(__FILE__) . '/../../../fixtures/templates'); + $noStatLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => null)); + $mtimeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime'))); + $sizeLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('size'))); + $bothLoader = new Mustache_Loader_ProductionFilesystemLoader($baseDir, array('stat_props' => array('mtime', 'size'))); + + $noStatKey = $noStatLoader->load('one.mustache')->getKey(); + $mtimeKey = $mtimeLoader->load('one.mustache')->getKey(); + $sizeKey = $sizeLoader->load('one.mustache')->getKey(); + $bothKey = $bothLoader->load('one.mustache')->getKey(); + + $this->assertNotEquals($noStatKey, $mtimeKey); + $this->assertNotEquals($noStatKey, $sizeKey); + $this->assertNotEquals($noStatKey, $bothKey); + $this->assertNotEquals($mtimeKey, $sizeKey); + $this->assertNotEquals($mtimeKey, $bothKey); + $this->assertNotEquals($sizeKey, $bothKey); + } } diff --git a/test/Mustache/Test/Source/FilesystemSourceTest.php b/test/Mustache/Test/Source/FilesystemSourceTest.php new file mode 100644 index 00000000..a636ffe5 --- /dev/null +++ b/test/Mustache/Test/Source/FilesystemSourceTest.php @@ -0,0 +1,25 @@ +getKey(); + } +} From 55e6ac81bae2517521518d192cd3dfba25fcb7f8 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:24:50 -0700 Subject: [PATCH 22/24] Add validation to prevent empty template_class_prefix. Fixes #298 --- src/Mustache/Engine.php | 4 ++++ test/Mustache/Test/EngineTest.php | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index 9227cadd..d63c7a18 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -142,6 +142,10 @@ class Mustache_Engine public function __construct(array $options = array()) { if (isset($options['template_class_prefix'])) { + if ((string) $options['template_class_prefix'] === '') { + throw new Mustache_Exception_InvalidArgumentException('Mustache Constructor "template_class_prefix" must not be empty'); + } + $this->templateClassPrefix = $options['template_class_prefix']; } diff --git a/test/Mustache/Test/EngineTest.php b/test/Mustache/Test/EngineTest.php index ed067326..3e4d193b 100644 --- a/test/Mustache/Test/EngineTest.php +++ b/test/Mustache/Test/EngineTest.php @@ -158,6 +158,16 @@ public function testWithoutLambdaCache() $this->assertNotSame($mustache->getCache(), $mustache->getProtectedLambdaCache()); } + /** + * @expectedException Mustache_Exception_InvalidArgumentException + */ + public function testEmptyTemplatePrefixThrowsException() + { + new Mustache_Engine(array( + 'template_class_prefix' => '', + )); + } + /** * @expectedException Mustache_Exception_InvalidArgumentException * @dataProvider getBadEscapers From 2540de2db2439621ee3a5f1cc6e47d8eca0941ce Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Mon, 3 Jul 2017 00:25:56 -0700 Subject: [PATCH 23/24] Minor CS fix. --- .../anchored_dot_notation/AnchoredDotNotation.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php index ee760596..c075f65c 100644 --- a/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php +++ b/test/fixtures/examples/anchored_dot_notation/AnchoredDotNotation.php @@ -13,20 +13,20 @@ class AnchoredDotNotation { public $genres = array( array( - 'name' => 'Punk', + 'name' => 'Punk', 'subgenres' => array( array( - 'name' => 'Hardcore', + 'name' => 'Hardcore', 'subgenres' => array( array( - 'name' => 'First wave of black metal', + 'name' => 'First wave of black metal', 'subgenres' => array( array('name' => 'Norwegian black metal'), array( - 'name' => 'Death metal', + 'name' => 'Death metal', 'subgenres' => array( array( - 'name' => 'Swedish death metal', + 'name' => 'Swedish death metal', 'subgenres' => array( array('name' => 'New wave of American metal'), ), @@ -36,11 +36,11 @@ class AnchoredDotNotation ), ), array( - 'name' => 'Thrash metal', + 'name' => 'Thrash metal', 'subgenres' => array( array('name' => 'Grindcore'), array( - 'name' => 'Metalcore', + 'name' => 'Metalcore', 'subgenres' => array( array('name' => 'Nu metal'), ), From 8c261cf50f2dd12b7a95ecece28a6f1feafad444 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Tue, 11 Jul 2017 05:53:22 -0700 Subject: [PATCH 24/24] Bump to v2.12.0 --- src/Mustache/Engine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mustache/Engine.php b/src/Mustache/Engine.php index d63c7a18..91109771 100644 --- a/src/Mustache/Engine.php +++ b/src/Mustache/Engine.php @@ -23,7 +23,7 @@ */ class Mustache_Engine { - const VERSION = '2.11.1'; + const VERSION = '2.12.0'; const SPEC_VERSION = '1.1.2'; const PRAGMA_FILTERS = 'FILTERS';