From 7a622650b996a98d901111d5df498ee667c07f64 Mon Sep 17 00:00:00 2001 From: B7th Date: Mon, 18 Jan 2016 15:24:38 -0800 Subject: [PATCH 1/2] Added import path simplification at compile method --- src/Compiler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Compiler.php b/src/Compiler.php index b19b9e56..9fa540cb 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -164,6 +164,10 @@ public function __construct() */ public function compile($code, $path = null) { + if(is_file($code)){ + $this->setImportPaths(basename($code)); + $code=file_get_contents($code); + } $locale = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, 'C'); From 0b7e833b813a9a2676902ca36cf221482b027874 Mon Sep 17 00:00:00 2001 From: B7th Date: Mon, 18 Jan 2016 15:30:58 -0800 Subject: [PATCH 2/2] dirname, not basename --- src/Compiler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Compiler.php b/src/Compiler.php index 9fa540cb..622b95bb 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -165,7 +165,7 @@ public function __construct() public function compile($code, $path = null) { if(is_file($code)){ - $this->setImportPaths(basename($code)); + $this->setImportPaths(dirname($code)); $code=file_get_contents($code); } $locale = setlocale(LC_NUMERIC, 0);