5 function __call($method, $params = null)
 
   7     $request = xmlrpc_encode_request($method, $params, array('escaping' => 'markup', 'encoding' => 'utf-8'));
 
   8     $context = stream_context_create(
 
  11                         'header' => 'Content-Type: text/xml',
 
  12                         'content' => $request)));
 
  14     $file = file_get_contents('http://localhost:8080/RPC2', false, $context);
 
  15     $response = xmlrpc_decode($file);
 
  17     if (is_array($response) && xmlrpc_is_fault($response)) {
 
  18         trigger_error("xmlrpc: {$response['faultString']} ({$response['faultCode']})");
 
  26 print_r(__call('stargazer.info'));
 
  27 $data = __call('stargazer.login', array('admin', '123456'));
 
  28 if (isset($data['cookie'])) {
 
  29     $cookie = $data['cookie'];
 
  31     print_r(__call('stargazer.get_tariffs', array($cookie)));
 
  32     print_r(__call('stargazer.logout', array($data['cookie'])));