Fix loading autoload.php file in CLI eesyphp tool

This commit is contained in:
Benjamin Renard 2023-02-26 19:09:22 +01:00
parent 1f93f6a885
commit bc54dd93e2

12
eesyphp
View file

@ -4,6 +4,16 @@
use EesyPHP\App;
use EesyPHP\Cli;
require __DIR__."/vendor/autoload.php";
if (isset($_composer_autoload_path))
require $_composer_autoload_path;
else if (file_exists(__DIR__ . '/../../autoload.php'))
require __DIR__ . '/../../autoload.php';
else if (file_exists(__DIR__ . '/../vendor/autoload.php'))
require __DIR__ . '/../vendor/autoload.php';
else if (file_exists(__DIR__."/vendor/autoload.php"))
require __DIR__."/vendor/autoload.php";
else
die("Fail to find composer vendor/autoload.php file\n");
App::init(null, null, __DIR__);
Cli :: handle_args();