Example #1
0
 public function __construct($mac, $hubName)
 {
     $this->_hub = $hubName;
     $this->_transport = new Transport($mac);
     $cfg = Config::getInstance();
     $protocal = $cfg->USE_HTTPS === true ? "https" : "http";
     $this->_baseURL = $protocal . "://" . $cfg->API_HOST . "/v2/hubs/" . $this->_hub;
 }
 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));
 }