hyperf.php 852 B

1234567891011121314151617181920212223242526
  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. //date_default_timezone_set('America/Toronto');
  9. ! defined('BASE_PATH') && define('BASE_PATH', dirname(__DIR__, 1));
  10. require BASE_PATH . '/vendor/autoload.php';
  11. ! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', Hyperf\Engine\DefaultOption::hookFlags());
  12. // Self-called anonymous function that creates its own scope and keep the global namespace clean.
  13. (function () {
  14. Hyperf\Di\ClassLoader::init();
  15. /** @var Psr\Container\ContainerInterface $container */
  16. $container = require BASE_PATH . '/config/container.php';
  17. $application = $container->get(Hyperf\Contract\ApplicationInterface::class);
  18. $application->run();
  19. })();