hyperf/bootstrap.php

31 lines
982 B
PHP
Raw Normal View History

2019-01-13 03:06:53 +08:00
<?php
2019-04-10 16:08:36 +08:00
2019-06-24 13:40:24 +08:00
declare(strict_types=1);
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
2020-07-15 17:05:45 +08:00
* @document https://hyperf.wiki
2019-06-24 13:40:24 +08:00
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
2019-06-24 13:40:24 +08:00
*/
2020-05-25 18:31:06 +08:00
use Hyperf\Config\Listener\RegisterPropertyHandlerListener;
use Hyperf\Di\Aop\AstVisitorRegistry;
use Hyperf\Di\Aop\PropertyHandlerVisitor;
use Hyperf\Di\Aop\ProxyCallVisitor;
use Hyperf\Di\Aop\RegisterInjectPropertyHandler;
2020-05-25 16:57:36 +08:00
2019-01-13 03:06:53 +08:00
! defined('BASE_PATH') && define('BASE_PATH', __DIR__);
2019-09-10 16:26:54 +08:00
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
2019-04-10 16:08:36 +08:00
2019-06-24 13:40:24 +08:00
require_once BASE_PATH . '/vendor/autoload.php';
2020-05-25 16:57:36 +08:00
// Register AST visitors to the collector.
AstVisitorRegistry::insert(PropertyHandlerVisitor::class, PHP_INT_MAX / 2);
AstVisitorRegistry::insert(ProxyCallVisitor::class, PHP_INT_MAX / 2);
// Register Property Handler.
RegisterInjectPropertyHandler::register();
2020-05-25 18:31:06 +08:00
(new RegisterPropertyHandlerListener())->process(new \stdClass());