includes/http.php
changeset 952 d52dfa1f08da
parent 894 83d180d87f3c
child 1034 15fa1b4e730a
equal deleted inserted replaced
951:745cccc6b97d 952:d52dfa1f08da
   237     {
   237     {
   238       $this->cookies_out[$cookiename] = $cookievalue;
   238       $this->cookies_out[$cookiename] = $cookievalue;
   239     }
   239     }
   240     else
   240     else
   241     {
   241     {
   242       throw new Exception(__CLASS__ . '::' . __METHOD__ . ': Invalid argument(s)');
   242       throw new Exception(__METHOD__ . ': Invalid argument(s)');
   243     }
   243     }
   244   }
   244   }
   245   
   245   
   246   /**
   246   /**
   247    * Sets one or more request header values.
   247    * Sets one or more request header values.
   262     {
   262     {
   263       $this->headers[$headername] = $headervalue;
   263       $this->headers[$headername] = $headervalue;
   264     }
   264     }
   265     else
   265     else
   266     {
   266     {
   267       throw new Exception(__CLASS__ . '::' . __METHOD__ . ': Invalid argument(s)');
   267       throw new Exception(__METHOD__ . ': Invalid argument(s)');
   268     }
   268     }
   269   }
   269   }
   270   
   270   
   271   /**
   271   /**
   272    * Adds one or more values to be passed on GET.
   272    * Adds one or more values to be passed on GET.
   287     {
   287     {
   288       $this->parms_get[$getname] = $getvalue;
   288       $this->parms_get[$getname] = $getvalue;
   289     }
   289     }
   290     else
   290     else
   291     {
   291     {
   292       throw new Exception(__CLASS__ . '::' . __METHOD__ . ': Invalid argument(s)');
   292       throw new Exception(__METHOD__ . ': Invalid argument(s)');
   293     }
   293     }
   294   }
   294   }
   295   
   295   
   296   /**
   296   /**
   297    * Adds one or more values to be passed on POST.
   297    * Adds one or more values to be passed on POST.
   312     {
   312     {
   313       $this->parms_post[$postname] = $postvalue;
   313       $this->parms_post[$postname] = $postvalue;
   314     }
   314     }
   315     else
   315     else
   316     {
   316     {
   317       throw new Exception(__CLASS__ . '::' . __METHOD__ . ': Invalid argument(s)');
   317       throw new Exception(__METHOD__ . ': Invalid argument(s)');
   318     }
   318     }
   319   }
   319   }
   320   
   320   
   321   /**
   321   /**
   322    * Internal function to open up the socket.
   322    * Internal function to open up the socket.
   324    */
   324    */
   325   
   325   
   326   function _sock_open(&$connection)
   326   function _sock_open(&$connection)
   327   {
   327   {
   328     // Open connection
   328     // Open connection
   329     $connection = fsockopen($this->host, $this->port);
   329     $connection = @fsockopen($this->host, $this->port);
   330     if ( !$connection )
   330     if ( !$connection )
   331       throw new Exception(__CLASS__ . '::' . __METHOD__ . ': Could not make connection');
   331       throw new Exception(__METHOD__ . ': Could not make connection');
   332     
   332     
   333     // 1 = socket open
   333     // 1 = socket open
   334     $this->state = 1;
   334     $this->state = 1;
   335   }
   335   }
   336   
   336