public function __construct($transport, $hub, $key) { $this->_transport = $transport; $this->_hub = $hub; $this->_key = $key; $cfg = Config::getInstance(); $protocal = $cfg->USE_HTTPS === true ? "https" : "http"; $this->_baseUrl = sprintf("%s://%s/%s/hubs/%s/streams/%s", $protocal, $cfg->API_HOST, $cfg->API_VERSION, $this->_hub, Utils::base64UrlEncode($this->_key)); }
public function testUrlSafe() { $a = '你好'; $b = Utils::base64UrlEncode($a); $this->assertEquals($a, Utils::base64UrlDecode($b)); }