start_register.php 887 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * This file is part of workerman.
  4. *
  5. * Licensed under The MIT License
  6. * For full copyright and license information, please see the MIT-LICENSE.txt
  7. * Redistributions of files must retain the above copyright notice.
  8. *
  9. * @author walkor<walkor@workerman.net>
  10. * @copyright walkor<walkor@workerman.net>
  11. * @link http://www.workerman.net/
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. require_once __DIR__.'/../../vendor/workerman/gateway-worker/src/Register.php';
  15. require_once __DIR__.'/../../vendor/workerman/workerman/Worker.php';
  16. use \Workerman\Worker;
  17. use \GatewayWorker\Register;
  18. require_once __DIR__ . '/../../vendor/autoload.php';
  19. // register 服务必须是text协议
  20. $register = new Register('text://0.0.0.0:2345');
  21. // 如果不是在根目录启动,则运行runAll方法
  22. if(!defined('GLOBAL_START'))
  23. {
  24. Worker::runAll();
  25. }