Test.php 433 B

12345678910111213141516171819202122
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. use \GatewayWorker\Lib\Gateway;
  5. class Test extends Controller
  6. {
  7. public function test(){
  8. $Gateway = new Gateway();
  9. $Gateway::$registerAddress = '127.0.0.1:2345';
  10. $Gateway::sendToAll('来自服务端的主动推送'.date('Y-m-d H:i:s'));
  11. }
  12. public function ip(){
  13. $ipaddress = ip_to_address();
  14. echo $ipaddress;
  15. }
  16. }