예제 #1
0
 public function __construct($apiKey)
 {
     $serverSDKUrl = SplitIOUtils\getSplitServerUrl();
     $serverEventsUrl = SplitIOUtils\getSplitEventsUrl();
     $config = new Config();
     $config->setUrl($serverSDKUrl);
     $config->setEventsUrl($serverEventsUrl);
     $config->setAuthorization($apiKey);
     $this->config = $config;
     //Adding Client configuration as Di value for all Client Resources.
     Di::set(Di::KEY_SPLIT_CLIENT_CONFIG, $config);
 }
예제 #2
0
 /**
  * Register the Split Client.
  */
 private function registerSplitHttpClient()
 {
     $apiKey = $this->get(OptionsEnum::API_KEY);
     if (empty($apiKey)) {
         $this->error("THE API KEY MUST NOT BE EMPTY!");
         exit(1);
     }
     //Setting the Split Client to connect Split servers
     if (Di::get(Di::KEY_SPLIT_CLIENT) === null) {
         Di::set(Di::KEY_SPLIT_CLIENT, new SplitIOClient($apiKey));
     }
 }