mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-05 15:27:56 +00:00
Clean up parameter names
This commit is contained in:
@@ -153,18 +153,18 @@ Curl::buildPostData($data)
|
||||
Curl::call()
|
||||
Curl::close()
|
||||
Curl::complete($callback)
|
||||
Curl::delete($url_mixed, $data = array())
|
||||
Curl::delete($url, $data = array())
|
||||
Curl::download($url, $mixed_filename)
|
||||
Curl::error($callback)
|
||||
Curl::exec($ch = null)
|
||||
Curl::get($url_mixed, $data = array())
|
||||
Curl::get($url, $data = array())
|
||||
Curl::getOpt($option)
|
||||
Curl::head($url_mixed, $data = array())
|
||||
Curl::head($url, $data = array())
|
||||
Curl::headerCallback($ch, $header)
|
||||
Curl::options($url_mixed, $data = array())
|
||||
Curl::patch($url_mixed, $data = array())
|
||||
Curl::post($url_mixed, $data = array())
|
||||
Curl::put($url_mixed, $data = array())
|
||||
Curl::options($url, $data = array())
|
||||
Curl::patch($url, $data = array())
|
||||
Curl::post($url, $data = array())
|
||||
Curl::put($url, $data = array())
|
||||
Curl::setBasicAuthentication($username, $password = '')
|
||||
Curl::setCookie($key, $value)
|
||||
Curl::setCookieFile($cookie_file)
|
||||
|
||||
+21
-35
@@ -140,13 +140,11 @@ class Curl
|
||||
$this->complete_function = $callback;
|
||||
}
|
||||
|
||||
public function delete($url_mixed, $data = array())
|
||||
public function delete($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url, $data);
|
||||
$this->unsetHeader('Content-Length');
|
||||
@@ -244,13 +242,11 @@ class Curl
|
||||
return $this->response;
|
||||
}
|
||||
|
||||
public function get($url_mixed, $data = array())
|
||||
public function get($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url, $data);
|
||||
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'GET');
|
||||
@@ -263,13 +259,11 @@ class Curl
|
||||
return $this->options[$option];
|
||||
}
|
||||
|
||||
public function head($url_mixed, $data = array())
|
||||
public function head($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url, $data);
|
||||
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'HEAD');
|
||||
@@ -283,13 +277,11 @@ class Curl
|
||||
return strlen($header);
|
||||
}
|
||||
|
||||
public function options($url_mixed, $data = array())
|
||||
public function options($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url, $data);
|
||||
$this->unsetHeader('Content-Length');
|
||||
@@ -297,13 +289,11 @@ class Curl
|
||||
return $this->exec();
|
||||
}
|
||||
|
||||
public function patch($url_mixed, $data = array())
|
||||
public function patch($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url);
|
||||
$this->unsetHeader('Content-Length');
|
||||
@@ -312,13 +302,11 @@ class Curl
|
||||
return $this->exec();
|
||||
}
|
||||
|
||||
public function post($url_mixed, $data = array())
|
||||
public function post($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
|
||||
if (is_array($data) && empty($data)) {
|
||||
@@ -332,13 +320,11 @@ class Curl
|
||||
return $this->exec();
|
||||
}
|
||||
|
||||
public function put($url_mixed, $data = array())
|
||||
public function put($url, $data = array())
|
||||
{
|
||||
if (is_array($url_mixed)) {
|
||||
if (is_array($url)) {
|
||||
$data = $url;
|
||||
$url = $this->base_url;
|
||||
$data = $url_mixed;
|
||||
} else {
|
||||
$url = $url_mixed;
|
||||
}
|
||||
$this->setURL($url);
|
||||
$this->setOpt(CURLOPT_CUSTOMREQUEST, 'PUT');
|
||||
|
||||
Reference in New Issue
Block a user