hyperf.php 965 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. ini_set('display_errors', 'on');
  12. ini_set('display_startup_errors', 'on');
  13. ini_set('memory_limit', '1G');
  14. error_reporting(E_ALL);
  15. ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
  16. require BASE_PATH . '/vendor/autoload.php';
  17. ! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags());
  18. // Self-called anonymous function that creates its own scope and keep the global namespace clean.
  19. (function () {
  20. Hyperf\Di\ClassLoader::init();
  21. /** @var Psr\Container\ContainerInterface $container */
  22. $container = require BASE_PATH . '/config/container.php';
  23. $application = $container->get(Hyperf\Contract\ApplicationInterface::class);
  24. $application->run();
  25. })();