hyperf.php 770 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env php
  2. <?php
  3. ini_set('display_errors', 'on');
  4. ini_set('display_startup_errors', 'on');
  5. error_reporting(E_ALL);
  6. ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
  7. ! defined('SWOOLE_HOOK_ALL') && define('SWOOLE_HOOK_ALL', null);
  8. ! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
  9. require BASE_PATH . '/vendor/autoload.php';
  10. // Self-called anonymous function that creates its own scope and keep the global namespace clean.
  11. (function () {
  12. Hyperf\Di\ClassLoader::init();
  13. /** @var \Psr\Container\ContainerInterface $container */
  14. $container = require BASE_PATH . '/config/container.php';
  15. $application = $container->get(\Hyperf\Contract\ApplicationInterface::class);
  16. $application->run();
  17. })();