hyperf.php 778 B

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