Skip to content

Commit

Permalink
add base_path alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
marcogiovinazzi committed Mar 28, 2018
1 parent bcdb1b7 commit 1a82aa7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion bin/extender
Expand Up @@ -6,7 +6,18 @@ use \Comodojo\Foundation\Console\Processor as ConsoleProcessor;
use \Comodojo\Extender\Components\CommandsLoader;
use \Comodojo\Extender\Components\Version;

$base_path = realpath(dirname(__FILE__)."/../../../../");
$base_path = '.';
$base_alternatives = [
realpath(dirname(__FILE__)."/../../../../"),
realpath(dirname(__FILE__)."/../../")
];

foreach ($base_alternatives as $alternative) {
if ( file_exists("$alternative/vendor/autoload.php") ) {
$base_path = $alternative;
break;
}
}

$autoloader = "$base_path/vendor/autoload.php";
$configuration = "$base_path/config/comodojo-configuration.yml";
Expand Down
13 changes: 12 additions & 1 deletion bin/extenderd
Expand Up @@ -6,7 +6,18 @@ use \Comodojo\Extender\Components\TasksLoader;
use \Comodojo\Extender\Components\PluginsLoader;
use \Comodojo\Foundation\Base\ConfigurationLoader;

$base_path = realpath(dirname(__FILE__)."/../../../../");
$base_path = '.';
$base_alternatives = [
realpath(dirname(__FILE__)."/../../../../"),
realpath(dirname(__FILE__)."/../../")
];

foreach ($base_alternatives as $alternative) {
if ( file_exists("$alternative/vendor/autoload.php") ) {
$base_path = $alternative;
break;
}
}

$autoloader = "$base_path/vendor/autoload.php";

Expand Down

0 comments on commit 1a82aa7

Please sign in to comment.