mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Merge branch 'maik-kulbe-feature/php-proxy-support'
This commit is contained in:
commit
59c189e3c9
@ -169,6 +169,22 @@ class ApiClient
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyHost()) {
|
||||
curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyPort()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyType()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyUser()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword());
|
||||
}
|
||||
|
||||
if (!empty($queryParams)) {
|
||||
$url = ($url . '?' . http_build_query($queryParams));
|
||||
}
|
||||
|
@ -131,6 +131,42 @@ class Configuration
|
||||
*/
|
||||
protected $sslVerification = true;
|
||||
|
||||
/**
|
||||
* Curl proxy host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyHost;
|
||||
|
||||
/**
|
||||
* Curl proxy port
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $proxyPort;
|
||||
|
||||
/**
|
||||
* Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5
|
||||
*
|
||||
* @see https://secure.php.net/manual/en/function.curl-setopt.php
|
||||
* @var integer
|
||||
*/
|
||||
protected $proxyType;
|
||||
|
||||
/**
|
||||
* Curl proxy username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyUser;
|
||||
|
||||
/**
|
||||
* Curl proxy password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyPassword;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@ -404,6 +440,122 @@ class Configuration
|
||||
return $this->curlConnectTimeout;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Host
|
||||
*
|
||||
* @param string $proxyHost HTTP Proxy URL
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyHost($proxyHost)
|
||||
{
|
||||
$this->proxyHost = $proxyHost;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Host
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyHost()
|
||||
{
|
||||
return $this->proxyHost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Port
|
||||
*
|
||||
* @param integer $proxyPort HTTP Proxy Port
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyPort($proxyPort)
|
||||
{
|
||||
$this->proxyPort = $proxyPort;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Port
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCurlProxyPort()
|
||||
{
|
||||
return $this->proxyPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Type
|
||||
*
|
||||
* @param integer $proxyType HTTP Proxy Type
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyType($proxyType)
|
||||
{
|
||||
$this->proxyType = $proxyType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Type
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCurlProxyType()
|
||||
{
|
||||
return $this->proxyType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy User
|
||||
*
|
||||
* @param string $proxyUser HTTP Proxy User
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyUser($proxyUser)
|
||||
{
|
||||
$this->proxyUser = $proxyUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy User
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyUser()
|
||||
{
|
||||
return $this->proxyUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Password
|
||||
*
|
||||
* @param string $proxyPassword HTTP Proxy Password
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyPassword($proxyPassword)
|
||||
{
|
||||
$this->proxyPassword = $proxyPassword;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyPassword()
|
||||
{
|
||||
return $this->proxyPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets debug flag
|
||||
*
|
||||
|
@ -109,6 +109,7 @@ Class | Method | HTTP request | Description
|
||||
- [ArrayOfArrayOfNumberOnly](docs/Model/ArrayOfArrayOfNumberOnly.md)
|
||||
- [ArrayOfNumberOnly](docs/Model/ArrayOfNumberOnly.md)
|
||||
- [ArrayTest](docs/Model/ArrayTest.md)
|
||||
- [Capitalization](docs/Model/Capitalization.md)
|
||||
- [Cat](docs/Model/Cat.md)
|
||||
- [Category](docs/Model/Category.md)
|
||||
- [ClassModel](docs/Model/ClassModel.md)
|
||||
|
@ -117,10 +117,6 @@ class StoreApi
|
||||
if ($order_id === null) {
|
||||
throw new \InvalidArgumentException('Missing the required parameter $order_id when calling deleteOrder');
|
||||
}
|
||||
if (($order_id < 1.0)) {
|
||||
throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.deleteOrder, must be bigger than or equal to 1.0.');
|
||||
}
|
||||
|
||||
// parse inputs
|
||||
$resourcePath = "/store/order/{orderId}";
|
||||
$httpBody = '';
|
||||
|
@ -179,6 +179,22 @@ class ApiClient
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyHost()) {
|
||||
curl_setopt($curl, CURLOPT_PROXY, $this->config->getCurlProxyHost());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyPort()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYPORT, $this->config->getCurlProxyPort());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyType()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYTYPE, $this->config->getCurlProxyType());
|
||||
}
|
||||
|
||||
if ($this->config->getCurlProxyUser()) {
|
||||
curl_setopt($curl, CURLOPT_PROXYUSERPWD, $this->config->getCurlProxyUser() . ':' .$this->config->getCurlProxyPassword());
|
||||
}
|
||||
|
||||
if (!empty($queryParams)) {
|
||||
$url = ($url . '?' . http_build_query($queryParams));
|
||||
}
|
||||
|
@ -141,6 +141,42 @@ class Configuration
|
||||
*/
|
||||
protected $sslVerification = true;
|
||||
|
||||
/**
|
||||
* Curl proxy host
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyHost;
|
||||
|
||||
/**
|
||||
* Curl proxy port
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
protected $proxyPort;
|
||||
|
||||
/**
|
||||
* Curl proxy type, e.g. CURLPROXY_HTTP or CURLPROXY_SOCKS5
|
||||
*
|
||||
* @see https://secure.php.net/manual/en/function.curl-setopt.php
|
||||
* @var integer
|
||||
*/
|
||||
protected $proxyType;
|
||||
|
||||
/**
|
||||
* Curl proxy username
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyUser;
|
||||
|
||||
/**
|
||||
* Curl proxy password
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $proxyPassword;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@ -414,6 +450,122 @@ class Configuration
|
||||
return $this->curlConnectTimeout;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Host
|
||||
*
|
||||
* @param string $proxyHost HTTP Proxy URL
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyHost($proxyHost)
|
||||
{
|
||||
$this->proxyHost = $proxyHost;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Host
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyHost()
|
||||
{
|
||||
return $this->proxyHost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Port
|
||||
*
|
||||
* @param integer $proxyPort HTTP Proxy Port
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyPort($proxyPort)
|
||||
{
|
||||
$this->proxyPort = $proxyPort;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Port
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCurlProxyPort()
|
||||
{
|
||||
return $this->proxyPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Type
|
||||
*
|
||||
* @param integer $proxyType HTTP Proxy Type
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyType($proxyType)
|
||||
{
|
||||
$this->proxyType = $proxyType;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Type
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCurlProxyType()
|
||||
{
|
||||
return $this->proxyType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy User
|
||||
*
|
||||
* @param string $proxyUser HTTP Proxy User
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyUser($proxyUser)
|
||||
{
|
||||
$this->proxyUser = $proxyUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy User
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyUser()
|
||||
{
|
||||
return $this->proxyUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the HTTP Proxy Password
|
||||
*
|
||||
* @param string $proxyPassword HTTP Proxy Password
|
||||
*
|
||||
* @return ApiClient
|
||||
*/
|
||||
public function setCurlProxyPassword($proxyPassword)
|
||||
{
|
||||
$this->proxyPassword = $proxyPassword;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the HTTP Proxy Password
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCurlProxyPassword()
|
||||
{
|
||||
return $this->proxyPassword;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets debug flag
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user