Exemplo n.º 1
0
 /**
  * 获取ApiClient的单例
  * @return \Wx\Wxserver\Compent\ApiClient
  */
 public static function instance()
 {
     if (empty(self::$APICLIENT)) {
         $swServerConfig = ApiConfig::swServerConfig();
         self::$APICLIENT = new self($swServerConfig['ip'], $swServerConfig['port']);
     }
     return self::$APICLIENT;
 }
Exemplo n.º 2
0
 /**
  * 判断Api服务器是不是已经启动
  */
 public static function isRun()
 {
     $swooleServerConfig = ApiConfig::swServerConfig();
     return NetUtil::checkPortUsed($swooleServerConfig['ip'], $swooleServerConfig['port']);
 }