mirror of
http://124.126.16.154:8888/singularity/HyperfDevelopmentKitCore.git
synced 2026-01-15 07:15:06 +08:00
30 lines
833 B
PHP
30 lines
833 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Hyperf\Context\ApplicationContext;
|
|
use Hyperf\Di\Container;
|
|
use Hyperf\Di\Definition\DefinitionSource;
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
ini_set('display_errors', 'on');
|
|
ini_set('display_startup_errors', 'on');
|
|
|
|
error_reporting(E_ALL);
|
|
date_default_timezone_set('Asia/Shanghai');
|
|
|
|
|
|
!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.');
|
|
}
|
|
$container = ApplicationContext::setContainer($container);
|