Procházet zdrojové kódy

Merge pull request #158 from mlebrun/master

Allow paths to include protocols prepended to the path.
Justin Hileman před 12 roky
rodič
revize
4b4d2deb99
1 změnil soubory, kde provedl 5 přidání a 1 odebrání
  1. 5 1
      src/Mustache/Loader/FilesystemLoader.php

+ 5 - 1
src/Mustache/Loader/FilesystemLoader.php

@@ -47,7 +47,11 @@ class Mustache_Loader_FilesystemLoader implements Mustache_Loader
      */
     public function __construct($baseDir, array $options = array())
     {
-        $this->baseDir = rtrim(realpath($baseDir), '/');
+        $this->baseDir = $baseDir;
+
+        if (strpos( $this->baseDir, '://' ) === -1) {
+            $this->baseDir = rtrim(realpath($this->baseDir), '/');
+        }
 
         if (!is_dir($this->baseDir)) {
             throw new Mustache_Exception_RuntimeException(sprintf('FilesystemLoader baseDir must be a directory: %s', $baseDir));