newone.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * run with command
  4. * php start.php start
  5. */
  6. ini_set('display_errors', 'on');
  7. use Workerman\Worker;
  8. if(strpos(strtolower(PHP_OS), 'win') === 0)
  9. {
  10. exit("start.php not support windows, please use start_for_win.bat\n");
  11. }
  12. // 检查扩展
  13. if(!extension_loaded('pcntl'))
  14. {
  15. exit("Please install pcntl extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
  16. }
  17. if(!extension_loaded('posix'))
  18. {
  19. exit("Please install posix extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
  20. }
  21. // 标记是全局启动
  22. define('GLOBAL_START', 1);
  23. require_once __DIR__ . '/vendor/autoload.php';
  24. // 加载所有Applications/*/start.php,以便启动所有服务
  25. require_once __DIR__.'/applications/chat/start_businessworker.php';
  26. require_once __DIR__.'/applications/chat/start_gateway.php';
  27. require_once __DIR__.'/applications/chat/start_register.php';
  28. /*define('APP_PATH', __DIR__.'/application/');
  29. require __DIR__.'/thinkphp/base.php';*/
  30. // 运行所有服务
  31. Worker::runAll();