diff --git a/core/com/http.com.php b/core/com/http.com.php index 401a423dc4..17163878e5 100644 --- a/core/com/http.com.php +++ b/core/com/http.com.php @@ -31,6 +31,7 @@ class com_http { private $sleepTime = 500000; private $post = ''; private $put = ''; + private $patch = ''; private $delete = ''; private $header = array('Connection: close'); private $cookiesession = false; @@ -95,6 +96,10 @@ public function exec($_timeout = 2, $_maxRetry = 3) { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT"); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getPut()); } + if ($this->getPatch() != '') { + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH"); + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getPatch()); + } if ($this->getDelete() != '') { curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getDelete()); @@ -248,6 +253,15 @@ public function setPut($put = array()) { return $this; } + public function getPatch() { + return $this->patch; + } + + public function setPatch($patch = array()) { + $this->patch = $patch; + return $this; + } + public function getUserAgent() { return $this->userAgent; } @@ -275,4 +289,4 @@ public function setCURLOPT($CURLOPT) { return $this; } -} +} \ No newline at end of file