MyQEE\Server\Clusters\Host::asArray PHP Method

asArray() public method

返回一个数组
public asArray ( ) : array
return array
    public function asArray()
    {
        $arr = ['group' => $this->group, 'id' => $this->id, 'ip' => $this->ip, 'port' => $this->port, 'key' => $this->key, 'worker_num' => $this->workerNum, 'encrypt' => $this->encrypt ? 1 : 0];
        if (self::$isRegisterServer) {
            $arr['fd'] = $this->fd;
            $arr['from_id'] = $this->fromId;
            $arr['removed'] = $this->removed;
        }
        return $arr;
    }