Allow to load non-local templates
This commit is contained in:
committed by
Justin Hileman
parent
6f6e3b9ddb
commit
fee4544785
@@ -52,10 +52,10 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
|
||||
|
||||
if (strpos($this->baseDir, '://') === false) {
|
||||
$this->baseDir = realpath($this->baseDir);
|
||||
}
|
||||
|
||||
if (!is_dir($this->baseDir)) {
|
||||
throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir));
|
||||
if (!is_dir($this->baseDir)) {
|
||||
throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir));
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists('extension', $options)) {
|
||||
@@ -99,7 +99,7 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
|
||||
{
|
||||
$fileName = $this->getFileName($name);
|
||||
|
||||
if (!file_exists($fileName)) {
|
||||
if (strpos($this->baseDir, '://') === false && !file_exists($fileName)) {
|
||||
throw new Mustache_Exception_UnknownTemplateException($name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user