From 3ff5a7902dcddc445fde998294b278439e6db942 Mon Sep 17 00:00:00 2001 From: Drajat Hasan Date: Sat, 26 Dec 2020 19:05:14 +0700 Subject: [PATCH] Fix : wrong path based environment --- src/SLiMSTarsius/Plugin.php | 2 +- src/SLiMSTarsius/Tarmagick.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SLiMSTarsius/Plugin.php b/src/SLiMSTarsius/Plugin.php index cd6ebd4..d867f9e 100644 --- a/src/SLiMSTarsius/Plugin.php +++ b/src/SLiMSTarsius/Plugin.php @@ -31,7 +31,7 @@ public function create($dest, $pluginName) ]; $destinantion = ($this->env === 'development_src')?$dest.'/tests/plugins/':$dest.'/plugins/'; - $template = ($this->env === 'development_src')?$dest.'/tests/template/':$dest.'/template/'; + $template = ($this->env === 'development_src')?$dest.'/tests/template/':$dest.'/vendor/drajat/slims-tarsius/tests/template/'; if (count(explode(' ', trim($pluginName))) > 1) { diff --git a/src/SLiMSTarsius/Tarmagick.php b/src/SLiMSTarsius/Tarmagick.php index aee701c..98b9308 100644 --- a/src/SLiMSTarsius/Tarmagick.php +++ b/src/SLiMSTarsius/Tarmagick.php @@ -16,7 +16,7 @@ class Tarmagick public static function plugin($action) { - self::getEnvironment(); + self::getEnvironment(self::$dir); echo (new \SLiMSTarsius\Plugin(self::$environment))->$action(self::$dir, self::$parameter); } @@ -35,11 +35,11 @@ public static function library($action) echo "Fitur akan hadir di masa mendatang :D, stay tune ya! \n"; } - public static function getEnvironment() + public static function getEnvironment($dir) { - if (file_exists(__DIR__.'/sysconfig.inc.php')) + if (file_exists($dir.'/sysconfig.inc.php')) { - include_once __DIR__.'/sysconfig.inc.php'; + include_once $dir.'/sysconfig.inc.php'; self::$environment = ENVIRONMENT; } else