Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix some errors with 'searchpath as array'

* H2o_File_Loader enforces an array, while H2o() doesn't
* undefined variable $filename in caching mechanism.

Amends: 53f5fda
  • Loading branch information...
commit 95128e90a5b3e4eb3316b82ed30001e5ddfb95ff 1 parent e524413
@vdboor vdboor authored
Showing with 5 additions and 4 deletions.
  1. +4 −3 h2o.php
  2. +1 −1  h2o/loaders.php
View
7 h2o.php
@@ -64,14 +64,15 @@ function __construct($file = null, $options = array()) {
throw new Exception('Invalid template loader');
if (isset($options['searchpath'])){
- $this->searchpath = $options['searchpath'];
+ $this->searchpath = $options['searchpath'];
} else if ($file) {
$this->searchpath = dirname(realpath($file)).DS;
} else {
$this->searchpath = getcwd().DS;
}
-
- $this->loader = new $loader($this->searchpath, $this->options);
+
+ $loader_searchpath = is_array($this->searchpath) ? $this->searchpath : array($this->searchpath);
+ $this->loader = new $loader($loader_searchpath, $this->options);
}
$this->loader->runtime = $this;
View
2  h2o/loaders.php
@@ -118,7 +118,7 @@ function expired($object) {
$files = array_merge(array($object->filename), $object->templates);
foreach ($files as $file) {
if (!is_file($file))
- $file = $this->get_template_path($this->searchpath,$filename);
+ $file = $this->get_template_path($this->searchpath, $file);
if ($object->created < filemtime($file))
return true;
Please sign in to comment.
Something went wrong with that request. Please try again.