**/ public function send_test($command = 'register_client', $params = array("discovery_url" => "https://seed.gluu.org/.well-known/openid-configuration", "redirect_url" => "https://rs.gluu.org/resources", "client_name" => "oxD Client", "response_types" => "code id_token token", "app_type" => "web", "grant_types" => "authorization_code implicit", "contacts" => "mike@gluu.org yuriy@gluu.org", "jwks_uri" => "https://seed.gluu.org/jwks")) { $this->data = array('command' => $command, 'params' => $params); $this->data = json_encode($this->data, JSON_PRETTY_PRINT); fwrite($this->socket, $this->data); } /** * getResult function geting result from oxD server. Print: response - The JSON response from the oxD Server and print **/ public function getResult() { $this->response = fread($this->socket, 8048); $object = json_decode($this->response); echo '<pre>'; var_dump($object); } /** * disconnect function closing connection . **/ public function disconnect() { fclose($this->socket); } } $client = new Client(); $client->send_test(); $client->getResult(); $client->disconnect();