Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Commit

Permalink
Fix : wrong path based environment
Browse files Browse the repository at this point in the history
  • Loading branch information
drajathasan committed Dec 26, 2020
1 parent 62735ee commit 3ff5a79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/SLiMSTarsius/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
8 changes: 4 additions & 4 deletions src/SLiMSTarsius/Tarmagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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
Expand Down

0 comments on commit 3ff5a79

Please sign in to comment.