summaryrefslogtreecommitdiff
path: root/inc/HTTPClient.php
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2014-10-01 11:30:27 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2014-10-01 11:30:27 +0200
commit42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0 (patch)
treed9cbd3d10d6b30e6b2092e39922b60e8616b4f92 /inc/HTTPClient.php
parent59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 (diff)
downloadrpg-42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0.tar.gz
rpg-42ea7f447f39fbc2f79eaaec31f8c10ede59c5d0.tar.bz2
Many PHPDocs, some unused and dyn declared vars
many PHPDocs some unused variables some dynamically declared variables declared
Diffstat (limited to 'inc/HTTPClient.php')
-rw-r--r--inc/HTTPClient.php39
1 files changed, 32 insertions, 7 deletions
diff --git a/inc/HTTPClient.php b/inc/HTTPClient.php
index ea20e3e56..2e991b52f 100644
--- a/inc/HTTPClient.php
+++ b/inc/HTTPClient.php
@@ -172,7 +172,8 @@ class HTTPClient {
*
* @param string $url The URL to fetch
* @param bool $sloppy304 Return body on 304 not modified
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function get($url,$sloppy304=false){
@@ -193,7 +194,8 @@ class HTTPClient {
* @param string $url The URL to fetch
* @param array $data Associative array of parameters
* @param bool $sloppy304 Return body on 304 not modified
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
+ *
* @author Andreas Gohr <andi@splitbrain.org>
*/
function dget($url,$data,$sloppy304=false){
@@ -213,7 +215,7 @@ class HTTPClient {
*
* @param string $url The URL to fetch
* @param array $data Associative array of parameters
- * @return bool|string response body, false on error
+ * @return false|string response body, false on error
* @author Andreas Gohr <andi@splitbrain.org>
*/
function post($url,$data){
@@ -235,6 +237,7 @@ class HTTPClient {
* @param mixed $data - the post data either as array or raw data
* @param string $method - HTTP Method usually GET or POST.
* @return bool - true on success
+ *
* @author Andreas Goetz <cpuidle@gmx.de>
* @author Andreas Gohr <andi@splitbrain.org>
*/
@@ -602,6 +605,7 @@ class HTTPClient {
* @param string $data The data to write
* @param string $message Description of what is being read
* @throws HTTPClientException
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _sendData($socket, $data, $message) {
@@ -646,6 +650,7 @@ class HTTPClient {
* @param bool $ignore_eof End-of-file is not an error if this is set
* @throws HTTPClientException
* @return string
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _readData($socket, $nbytes, $message, $ignore_eof = false) {
@@ -695,6 +700,7 @@ class HTTPClient {
* @param string $message Description of what is being read
* @throws HTTPClientException
* @return string
+ *
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
function _readLine($socket, $message) {
@@ -729,6 +735,9 @@ class HTTPClient {
* Uses _debug_text or _debug_html depending on the SAPI name
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $info
+ * @param mixed $var
*/
function _debug($info,$var=null){
if(!$this->debug) return;
@@ -742,8 +751,8 @@ class HTTPClient {
/**
* print debug info as HTML
*
- * @param $info
- * @param null $var
+ * @param string $info
+ * @param mixed $var
*/
function _debug_html($info, $var=null){
print '<b>'.$info.'</b> '.($this->_time() - $this->start).'s<br />';
@@ -759,8 +768,8 @@ class HTTPClient {
/**
* prints debug info as plain text
*
- * @param $info
- * @param null $var
+ * @param string $info
+ * @param mixed $var
*/
function _debug_text($info, $var=null){
print '*'.$info.'* '.($this->_time() - $this->start)."s\n";
@@ -770,6 +779,8 @@ class HTTPClient {
/**
* Return current timestamp in microsecond resolution
+ *
+ * @return float
*/
static function _time(){
list($usec, $sec) = explode(" ", microtime());
@@ -782,6 +793,9 @@ class HTTPClient {
* All Keys are lowercased.
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param string $string
+ * @return array
*/
function _parseHeaders($string){
$headers = array();
@@ -810,6 +824,9 @@ class HTTPClient {
* convert given header array to header string
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $headers
+ * @return string
*/
function _buildHeaders($headers){
$string = '';
@@ -824,6 +841,8 @@ class HTTPClient {
* get cookies as http header string
*
* @author Andreas Goetz <cpuidle@gmx.de>
+ *
+ * @return string
*/
function _getCookies(){
$headers = '';
@@ -839,6 +858,9 @@ class HTTPClient {
* Encode data for posting
*
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data
+ * @return string
*/
function _postEncode($data){
return http_build_query($data,'','&');
@@ -849,6 +871,9 @@ class HTTPClient {
*
* @fixme use of urlencode might be wrong here
* @author Andreas Gohr <andi@splitbrain.org>
+ *
+ * @param array $data
+ * @return string
*/
function _postMultipartEncode($data){
$boundary = '--'.$this->boundary;