2022-12-19 17:20:04 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2023-09-26 10:41:15 +08:00
|
|
|
|
|
|
|
|
use Hyperf\Context\ApplicationContext;
|
|
|
|
|
use Hyperf\Di\Container;
|
|
|
|
|
use Hyperf\Di\Definition\DefinitionSource;
|
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
|
|
2022-12-19 17:20:04 +08:00
|
|
|
ini_set('display_errors', 'on');
|
|
|
|
|
ini_set('display_startup_errors', 'on');
|
|
|
|
|
|
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
date_default_timezone_set('Asia/Shanghai');
|
2023-09-26 10:41:15 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
!defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
|
|
|
|
|
!defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
|
|
|
|
|
|
|
|
|
Swoole\Runtime::enableCoroutine(true);
|
|
|
|
|
|
|
|
|
|
require BASE_PATH . '/vendor/autoload.php';
|
|
|
|
|
Hyperf\Di\ClassLoader::init();
|
|
|
|
|
|
|
|
|
|
$container = new Container(new DefinitionSource([]));
|
|
|
|
|
if (!$container instanceof ContainerInterface) {
|
|
|
|
|
throw new RuntimeException('The dependency injection container is invalid.');
|
|
|
|
|
}
|
2023-12-04 17:12:12 +08:00
|
|
|
$container = ApplicationContext::setContainer($container);
|