Pass Composer autoloader to Container

This commit is contained in:
Visman 2023-10-12 20:50:07 +07:00
parent e42fc8d9f0
commit 16d62d4bc2

View file

@ -42,8 +42,7 @@ define('FORK_GEN_FEM', 2);
define('FORK_JSON_ENCODE', \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE | \JSON_THROW_ON_ERROR);
require __DIR__ . '/../vendor/autoload.php';
$loader = require __DIR__ . '/../vendor/autoload.php';
$errorHandler = new ErrorHandler();
if (\is_file(__DIR__ . '/config/main.php')) {
@ -54,6 +53,8 @@ if (\is_file(__DIR__ . '/config/main.php')) {
throw new RuntimeException('Application is not configured');
}
$c->autoloader = $loader;
$errorHandler->setContainer($c);
require __DIR__ . '/functions.php';