diff --git a/lib/mustache/README.md b/lib/mustache/README.md index 6a309aee484..a596ace8dee 100644 --- a/lib/mustache/README.md +++ b/lib/mustache/README.md @@ -5,6 +5,7 @@ A [Mustache](http://mustache.github.com/) implementation in PHP. [![Package version](http://img.shields.io/packagist/v/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache) [![Build status](http://img.shields.io/travis/bobthecow/mustache.php/dev.svg?style=flat-square)](http://travis-ci.org/bobthecow/mustache.php) +[![StyleCI](https://styleci.io/repos/569670/shield)](https://styleci.io/repos/569670) [![Monthly downloads](http://img.shields.io/packagist/dm/mustache/mustache.svg?style=flat-square)](https://packagist.org/packages/mustache/mustache) diff --git a/lib/mustache/readme_moodle.txt b/lib/mustache/readme_moodle.txt index e443e5893ce..6938c7dd2c4 100644 --- a/lib/mustache/readme_moodle.txt +++ b/lib/mustache/readme_moodle.txt @@ -23,3 +23,7 @@ Copy into this folder, and update this readme to cover any changes. == 3.1 == Update from version 2.9.0 to 2.10.0 + +== 3.2 == + +Update from version 2.10.0 to 2.11.1 diff --git a/lib/mustache/src/Mustache/Autoloader.php b/lib/mustache/src/Mustache/Autoloader.php index b33bc24fc68..b16ac1427f4 100644 --- a/lib/mustache/src/Mustache/Autoloader.php +++ b/lib/mustache/src/Mustache/Autoloader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Cache.php b/lib/mustache/src/Mustache/Cache.php index 5df8a23d82d..7b465abdffd 100644 --- a/lib/mustache/src/Mustache/Cache.php +++ b/lib/mustache/src/Mustache/Cache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Cache/AbstractCache.php b/lib/mustache/src/Mustache/Cache/AbstractCache.php index cf1c0416b7b..495090b6d96 100644 --- a/lib/mustache/src/Mustache/Cache/AbstractCache.php +++ b/lib/mustache/src/Mustache/Cache/AbstractCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Cache/FilesystemCache.php b/lib/mustache/src/Mustache/Cache/FilesystemCache.php index 5b56222b49e..0dbe8f9df5d 100644 --- a/lib/mustache/src/Mustache/Cache/FilesystemCache.php +++ b/lib/mustache/src/Mustache/Cache/FilesystemCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -27,8 +27,8 @@ class Mustache_Cache_FilesystemCache extends Mustache_Cache_AbstractCache /** * Filesystem cache constructor. * - * @param string $baseDir Directory for compiled templates. - * @param int $fileMode Override default permissions for cache files. Defaults to using the system-defined umask. + * @param string $baseDir Directory for compiled templates + * @param int $fileMode Override default permissions for cache files. Defaults to using the system-defined umask */ public function __construct($baseDir, $fileMode = null) { diff --git a/lib/mustache/src/Mustache/Cache/NoopCache.php b/lib/mustache/src/Mustache/Cache/NoopCache.php index 7a4b55b5da5..ca0007dee13 100644 --- a/lib/mustache/src/Mustache/Cache/NoopCache.php +++ b/lib/mustache/src/Mustache/Cache/NoopCache.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Compiler.php b/lib/mustache/src/Mustache/Compiler.php index 76e580c7f2b..2a831d6ecde 100644 --- a/lib/mustache/src/Mustache/Compiler.php +++ b/lib/mustache/src/Mustache/Compiler.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -75,7 +75,7 @@ class Mustache_Compiler /** * Helper function for walking the Mustache token parse tree. * - * @throws Mustache_Exception_SyntaxException upon encountering unknown token types. + * @throws Mustache_Exception_SyntaxException upon encountering unknown token types * * @param array $tree Parse tree of Mustache tokens * @param int $level (default: 0) @@ -191,7 +191,7 @@ class Mustache_Compiler { $this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context); $buffer = \'\'; - $newContext = array(); + $blocksContext = array(); %s return $buffer; @@ -207,7 +207,7 @@ class Mustache_Compiler public function renderInternal(Mustache_Context $context, $indent = \'\') { $buffer = \'\'; - $newContext = array(); + $blocksContext = array(); %s return $buffer; @@ -264,7 +264,7 @@ class Mustache_Compiler return sprintf($this->prepare(self::BLOCK_VAR, $level), $id, $this->walk($nodes, $level)); } - const BLOCK_ARG = '$newContext[%s] = array($this, \'block%s\');'; + const BLOCK_ARG = '$blocksContext[%s] = array($this, \'block%s\');'; /** * Generate Mustache Template inheritance block argument PHP source. @@ -291,7 +291,8 @@ class Mustache_Compiler const BLOCK_FUNCTION = ' public function block%s($context) { - $indent = $buffer = \'\';%s + $indent = $buffer = \'\'; + $blocksContext = array();%s return $buffer; } @@ -326,6 +327,8 @@ class Mustache_Compiler private function section%s(Mustache_Context $context, $indent, $value) { $buffer = \'\'; + $blocksContext = array(); + if (%s) { $source = %s; $result = call_user_func($value, $source, %s); @@ -456,8 +459,8 @@ class Mustache_Compiler const PARENT = ' %s - if ($parent = $this->mustache->LoadPartial(%s)) { - $context->pushBlockContext($newContext); + if ($parent = $this->mustache->loadPartial(%s)) { + $context->pushBlockContext($blocksContext); $buffer .= $parent->renderInternal($context, $indent); $context->popBlockContext(); } @@ -490,7 +493,7 @@ class Mustache_Compiler * * @param array $node * - * @return bool True if $node is a block arg token. + * @return bool True if $node is a block arg token */ private static function onlyBlockArgs(array $node) { diff --git a/lib/mustache/src/Mustache/Context.php b/lib/mustache/src/Mustache/Context.php index e660b543854..f59faea8a62 100644 --- a/lib/mustache/src/Mustache/Context.php +++ b/lib/mustache/src/Mustache/Context.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -150,7 +150,7 @@ class Mustache_Context * * @see Mustache_Context::findDot * - * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id. + * @throws Mustache_Exception_InvalidArgumentException if given an invalid anchored dot $id * * @param string $id Dotted variable selector * @@ -182,7 +182,7 @@ class Mustache_Context * * @param string $id * - * @return mixed Variable value, or '' if not found. + * @return mixed Variable value, or '' if not found */ public function findInBlock($id) { diff --git a/lib/mustache/src/Mustache/Engine.php b/lib/mustache/src/Mustache/Engine.php index fe119121895..856d4efe65e 100644 --- a/lib/mustache/src/Mustache/Engine.php +++ b/lib/mustache/src/Mustache/Engine.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -23,7 +23,7 @@ */ class Mustache_Engine { - const VERSION = '2.10.0'; + const VERSION = '2.11.1'; const SPEC_VERSION = '1.1.2'; const PRAGMA_FILTERS = 'FILTERS'; @@ -126,7 +126,7 @@ class Mustache_Engine * 'pragmas' => [Mustache_Engine::PRAGMA_FILTERS], * ); * - * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable. + * @throws Mustache_Exception_InvalidArgumentException If `escape` option is not callable * * @param array $options (default: array()) */ @@ -429,7 +429,7 @@ class Mustache_Engine /** * Set the Mustache Logger instance. * - * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface. + * @throws Mustache_Exception_InvalidArgumentException If logger is not an instance of Mustache_Logger or Psr\Log\LoggerInterface * * @param Mustache_Logger|Psr\Log\LoggerInterface $logger */ diff --git a/lib/mustache/src/Mustache/Exception.php b/lib/mustache/src/Mustache/Exception.php index 7c047926d96..66bd6bd47a0 100644 --- a/lib/mustache/src/Mustache/Exception.php +++ b/lib/mustache/src/Mustache/Exception.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Exception/InvalidArgumentException.php b/lib/mustache/src/Mustache/Exception/InvalidArgumentException.php index c6084b8e6b9..46b200c6c8a 100644 --- a/lib/mustache/src/Mustache/Exception/InvalidArgumentException.php +++ b/lib/mustache/src/Mustache/Exception/InvalidArgumentException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Exception/LogicException.php b/lib/mustache/src/Mustache/Exception/LogicException.php index 4bfda5f4cbf..8e75e7e1101 100644 --- a/lib/mustache/src/Mustache/Exception/LogicException.php +++ b/lib/mustache/src/Mustache/Exception/LogicException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Exception/RuntimeException.php b/lib/mustache/src/Mustache/Exception/RuntimeException.php index 5eb90ddd38e..9a7b90b52cc 100644 --- a/lib/mustache/src/Mustache/Exception/RuntimeException.php +++ b/lib/mustache/src/Mustache/Exception/RuntimeException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Exception/SyntaxException.php b/lib/mustache/src/Mustache/Exception/SyntaxException.php index ab4d6aa8a33..4fcb39d7e96 100644 --- a/lib/mustache/src/Mustache/Exception/SyntaxException.php +++ b/lib/mustache/src/Mustache/Exception/SyntaxException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,13 +17,18 @@ class Mustache_Exception_SyntaxException extends LogicException implements Musta protected $token; /** - * @param string $msg - * @param array $token + * @param string $msg + * @param array $token + * @param Exception $previous */ - public function __construct($msg, array $token) + public function __construct($msg, array $token, Exception $previous = null) { $this->token = $token; - parent::__construct($msg); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($msg, 0, $previous); + } else { + parent::__construct($msg); + } } /** diff --git a/lib/mustache/src/Mustache/Exception/UnknownFilterException.php b/lib/mustache/src/Mustache/Exception/UnknownFilterException.php index 43d2c06d987..44505e493b5 100644 --- a/lib/mustache/src/Mustache/Exception/UnknownFilterException.php +++ b/lib/mustache/src/Mustache/Exception/UnknownFilterException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownFilterException extends UnexpectedValueException protected $filterName; /** - * @param string $filterName + * @param string $filterName + * @param Exception $previous */ - public function __construct($filterName) + public function __construct($filterName, Exception $previous = null) { $this->filterName = $filterName; - parent::__construct(sprintf('Unknown filter: %s', $filterName)); + $message = sprintf('Unknown filter: %s', $filterName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); + } } public function getFilterName() diff --git a/lib/mustache/src/Mustache/Exception/UnknownHelperException.php b/lib/mustache/src/Mustache/Exception/UnknownHelperException.php index 7fe4a71e422..e1bc4d2cd3d 100644 --- a/lib/mustache/src/Mustache/Exception/UnknownHelperException.php +++ b/lib/mustache/src/Mustache/Exception/UnknownHelperException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownHelperException extends InvalidArgumentException protected $helperName; /** - * @param string $helperName + * @param string $helperName + * @param Exception $previous */ - public function __construct($helperName) + public function __construct($helperName, Exception $previous = null) { $this->helperName = $helperName; - parent::__construct(sprintf('Unknown helper: %s', $helperName)); + $message = sprintf('Unknown helper: %s', $helperName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); + } } public function getHelperName() diff --git a/lib/mustache/src/Mustache/Exception/UnknownTemplateException.php b/lib/mustache/src/Mustache/Exception/UnknownTemplateException.php index f1f69bf31fc..0c37796280f 100644 --- a/lib/mustache/src/Mustache/Exception/UnknownTemplateException.php +++ b/lib/mustache/src/Mustache/Exception/UnknownTemplateException.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,12 +17,18 @@ class Mustache_Exception_UnknownTemplateException extends InvalidArgumentExcepti protected $templateName; /** - * @param string $templateName + * @param string $templateName + * @param Exception $previous */ - public function __construct($templateName) + public function __construct($templateName, Exception $previous = null) { $this->templateName = $templateName; - parent::__construct(sprintf('Unknown template: %s', $templateName)); + $message = sprintf('Unknown template: %s', $templateName); + if (version_compare(PHP_VERSION, '5.3.0', '>=')) { + parent::__construct($message, 0, $previous); + } else { + parent::__construct($message); + } } public function getTemplateName() diff --git a/lib/mustache/src/Mustache/HelperCollection.php b/lib/mustache/src/Mustache/HelperCollection.php index 0a92428e924..86c56b78147 100644 --- a/lib/mustache/src/Mustache/HelperCollection.php +++ b/lib/mustache/src/Mustache/HelperCollection.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -81,7 +81,7 @@ class Mustache_HelperCollection /** * Get a helper by name. * - * @throws Mustache_Exception_UnknownHelperException If helper does not exist. + * @throws Mustache_Exception_UnknownHelperException If helper does not exist * * @param string $name * @@ -137,7 +137,7 @@ class Mustache_HelperCollection /** * Check whether a given helper is present in the collection. * - * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present. + * @throws Mustache_Exception_UnknownHelperException if the requested helper is not present * * @param string $name */ diff --git a/lib/mustache/src/Mustache/LambdaHelper.php b/lib/mustache/src/Mustache/LambdaHelper.php index cb8e96698fa..1d203d5ddac 100644 --- a/lib/mustache/src/Mustache/LambdaHelper.php +++ b/lib/mustache/src/Mustache/LambdaHelper.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -25,8 +25,8 @@ class Mustache_LambdaHelper /** * Mustache Lambda Helper constructor. * - * @param Mustache_Engine $mustache Mustache engine instance. - * @param Mustache_Context $context Rendering context. + * @param Mustache_Engine $mustache Mustache engine instance + * @param Mustache_Context $context Rendering context * @param string $delims Optional custom delimiters, in the format `{{= <% %> =}}`. (default: null) */ public function __construct(Mustache_Engine $mustache, Mustache_Context $context, $delims = null) @@ -41,7 +41,7 @@ class Mustache_LambdaHelper * * @param string $string * - * @return string Rendered template. + * @return string Rendered template */ public function render($string) { @@ -65,7 +65,7 @@ class Mustache_LambdaHelper /** * Get a Lambda Helper with custom delimiters. * - * @param string $delims Custom delimiters, in the format `{{= <% %> =}}`. + * @param string $delims Custom delimiters, in the format `{{= <% %> =}}` * * @return Mustache_LambdaHelper */ diff --git a/lib/mustache/src/Mustache/Loader.php b/lib/mustache/src/Mustache/Loader.php index 1b075d05e0f..c5e1a19af43 100644 --- a/lib/mustache/src/Mustache/Loader.php +++ b/lib/mustache/src/Mustache/Loader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -17,7 +17,7 @@ interface Mustache_Loader /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/lib/mustache/src/Mustache/Loader/ArrayLoader.php b/lib/mustache/src/Mustache/Loader/ArrayLoader.php index 90cecca5894..c0d6a4d4ac5 100644 --- a/lib/mustache/src/Mustache/Loader/ArrayLoader.php +++ b/lib/mustache/src/Mustache/Loader/ArrayLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -41,7 +41,7 @@ class Mustache_Loader_ArrayLoader implements Mustache_Loader, Mustache_Loader_Mu /** * Load a Template. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/lib/mustache/src/Mustache/Loader/CascadingLoader.php b/lib/mustache/src/Mustache/Loader/CascadingLoader.php index 09a376cd13e..b4726bc779f 100644 --- a/lib/mustache/src/Mustache/Loader/CascadingLoader.php +++ b/lib/mustache/src/Mustache/Loader/CascadingLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -48,7 +48,7 @@ class Mustache_Loader_CascadingLoader implements Mustache_Loader /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/lib/mustache/src/Mustache/Loader/FilesystemLoader.php b/lib/mustache/src/Mustache/Loader/FilesystemLoader.php index e2aab781c3a..a31375133ed 100644 --- a/lib/mustache/src/Mustache/Loader/FilesystemLoader.php +++ b/lib/mustache/src/Mustache/Loader/FilesystemLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -40,9 +40,9 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader * 'extension' => '.ms', * ); * - * @throws Mustache_Exception_RuntimeException if $baseDir does not exist. + * @throws Mustache_Exception_RuntimeException if $baseDir does not exist * - * @param string $baseDir Base directory containing Mustache template files. + * @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()) @@ -53,7 +53,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader $this->baseDir = realpath($this->baseDir); } - if (!is_dir($this->baseDir)) { + if ($this->shouldCheckPath() && !is_dir($this->baseDir)) { throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir)); } @@ -88,7 +88,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader /** * Helper function for loading a Mustache file by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * @@ -98,7 +98,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader { $fileName = $this->getFileName($name); - if (!file_exists($fileName)) { + if ($this->shouldCheckPath() && !file_exists($fileName)) { throw new Mustache_Exception_UnknownTemplateException($name); } @@ -121,4 +121,15 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader return $fileName; } + + /** + * Only check if baseDir is a directory and requested templates are files if + * baseDir is using the filesystem stream wrapper. + * + * @return bool Whether to check `is_dir` and `file_exists` + */ + protected function shouldCheckPath() + { + return strpos($this->baseDir, '://') === false || strpos($this->baseDir, 'file://') === 0; + } } diff --git a/lib/mustache/src/Mustache/Loader/InlineLoader.php b/lib/mustache/src/Mustache/Loader/InlineLoader.php index 297093770a6..f6d4b179d5e 100644 --- a/lib/mustache/src/Mustache/Loader/InlineLoader.php +++ b/lib/mustache/src/Mustache/Loader/InlineLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -68,7 +68,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader * @param string $fileName The file to parse for inline templates * @param int $offset A string offset for the start of the templates. * This usually coincides with the `__halt_compiler` - * call, and the `__COMPILER_HALT_OFFSET__`. + * call, and the `__COMPILER_HALT_OFFSET__` */ public function __construct($fileName, $offset) { @@ -87,7 +87,7 @@ class Mustache_Loader_InlineLoader implements Mustache_Loader /** * Load a Template by name. * - * @throws Mustache_Exception_UnknownTemplateException If a template file is not found. + * @throws Mustache_Exception_UnknownTemplateException If a template file is not found * * @param string $name * diff --git a/lib/mustache/src/Mustache/Loader/MutableLoader.php b/lib/mustache/src/Mustache/Loader/MutableLoader.php index 4855c1654cb..f228d90794e 100644 --- a/lib/mustache/src/Mustache/Loader/MutableLoader.php +++ b/lib/mustache/src/Mustache/Loader/MutableLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Loader/StringLoader.php b/lib/mustache/src/Mustache/Loader/StringLoader.php index 99fb38e46e8..79b616bf9ee 100644 --- a/lib/mustache/src/Mustache/Loader/StringLoader.php +++ b/lib/mustache/src/Mustache/Loader/StringLoader.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Logger.php b/lib/mustache/src/Mustache/Logger.php index 93c27f6bfab..324a7ce5a60 100644 --- a/lib/mustache/src/Mustache/Logger.php +++ b/lib/mustache/src/Mustache/Logger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Logger/AbstractLogger.php b/lib/mustache/src/Mustache/Logger/AbstractLogger.php index 1c27db9c506..64bdf663753 100644 --- a/lib/mustache/src/Mustache/Logger/AbstractLogger.php +++ b/lib/mustache/src/Mustache/Logger/AbstractLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Logger/StreamLogger.php b/lib/mustache/src/Mustache/Logger/StreamLogger.php index 88f30000c45..efb32318276 100644 --- a/lib/mustache/src/Mustache/Logger/StreamLogger.php +++ b/lib/mustache/src/Mustache/Logger/StreamLogger.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -36,7 +36,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger protected $url = null; /** - * @throws InvalidArgumentException if the logging level is unknown. + * @throws InvalidArgumentException if the logging level is unknown * * @param resource|string $stream Resource instance or URL * @param int $level The minimum logging level at which this handler will be triggered @@ -65,7 +65,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger /** * Set the minimum logging level. * - * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown. + * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown * * @param int $level The minimum logging level which will be written */ @@ -91,7 +91,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger /** * Logs with an arbitrary level. * - * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown. + * @throws Mustache_Exception_InvalidArgumentException if the logging level is unknown * * @param mixed $level * @param string $message @@ -111,8 +111,8 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger /** * Write a record to the log. * - * @throws Mustache_Exception_LogicException If neither a stream resource nor url is present. - * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened. + * @throws Mustache_Exception_LogicException If neither a stream resource nor url is present + * @throws Mustache_Exception_RuntimeException If the stream url cannot be opened * * @param int $level The logging level * @param string $message The log message @@ -139,7 +139,7 @@ class Mustache_Logger_StreamLogger extends Mustache_Logger_AbstractLogger /** * Gets the name of the logging level. * - * @throws InvalidArgumentException if the logging level is unknown. + * @throws InvalidArgumentException if the logging level is unknown * * @param int $level * diff --git a/lib/mustache/src/Mustache/Parser.php b/lib/mustache/src/Mustache/Parser.php index 7d3559b740f..adefebdd1bb 100644 --- a/lib/mustache/src/Mustache/Parser.php +++ b/lib/mustache/src/Mustache/Parser.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -63,7 +63,7 @@ class Mustache_Parser /** * Helper method for recursively building a parse tree. * - * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered. + * @throws Mustache_Exception_SyntaxException when nesting errors or mismatched section tags are encountered * * @param array &$tokens Set of Mustache tokens * @param array $parent Parent token (default: null) @@ -195,10 +195,10 @@ class Mustache_Parser * * Returns a whitespace token for indenting partials, if applicable. * - * @param array $nodes Parsed nodes. - * @param array $tokens Tokens to be parsed. + * @param array $nodes Parsed nodes + * @param array $tokens Tokens to be parsed * - * @return array|null Resulting indent token, if any. + * @return array|null Resulting indent token, if any */ private function clearStandaloneLines(array &$nodes, array &$tokens) { @@ -268,7 +268,7 @@ class Mustache_Parser /** * Check whether a token is allowed inside a parent tag. * - * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag. + * @throws Mustache_Exception_SyntaxException if an invalid token is found inside a parent tag * * @param array|null $parent * @param array $token diff --git a/lib/mustache/src/Mustache/Template.php b/lib/mustache/src/Mustache/Template.php index f2d198f22c3..2b7771c4268 100644 --- a/lib/mustache/src/Mustache/Template.php +++ b/lib/mustache/src/Mustache/Template.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/lib/mustache/src/Mustache/Tokenizer.php b/lib/mustache/src/Mustache/Tokenizer.php index a71df2ce822..27e4d05ec88 100644 --- a/lib/mustache/src/Mustache/Tokenizer.php +++ b/lib/mustache/src/Mustache/Tokenizer.php @@ -3,7 +3,7 @@ /* * This file is part of Mustache.php. * - * (c) 2010-2015 Justin Hileman + * (c) 2010-2016 Justin Hileman * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -80,7 +80,7 @@ class Mustache_Tokenizer /** * Scan and tokenize template source. * - * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered. + * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered * * @param string $text Mustache template source to tokenize * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: null) diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml index 8acc232fc55..3f8b8e1ff14 100644 --- a/lib/thirdpartylibs.xml +++ b/lib/thirdpartylibs.xml @@ -227,7 +227,7 @@ mustache Mustache MIT - 2.10.0 + 2.11.1 amd/src/mustache.js