Merge pull request #1702 from wing328/php_profile

[PHP] add Php profiler for petstore sample
This commit is contained in:
wing328 2015-12-11 12:29:17 +08:00
commit 207b14283c
3 changed files with 12 additions and 12 deletions

View File

@ -184,14 +184,14 @@ use \{{invokerPackage}}\ObjectSerializer;
{{#authMethods}}{{#isApiKey}}
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('{{keyParamName}}');
if ($apiKey !== null) {
if (strlen($apiKey) !== 0) {
{{#isKeyInHeader}}$headerParams['{{keyParamName}}'] = $apiKey;{{/isKeyInHeader}}{{#isKeyInQuery}}$queryParams['{{keyParamName}}'] = $apiKey;{{/isKeyInQuery}}
}{{/isApiKey}}
{{#isBasic}}// this endpoint requires HTTP basic authentication
if ($this->apiClient->getConfig()->getUsername() !== null or $this->apiClient->getConfig()->getPassword() !== null) {
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) {
$headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
}{{/isBasic}}{{#isOAuth}}// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}{{/isOAuth}}
{{/authMethods}}

View File

@ -152,7 +152,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -235,7 +235,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -317,7 +317,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -407,7 +407,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -506,7 +506,7 @@ class PetApi
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
if ($apiKey !== null) {
if (strlen($apiKey) !== 0) {
$headerParams['api_key'] = $apiKey;
}
@ -621,7 +621,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -716,7 +716,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}
@ -828,7 +828,7 @@ class PetApi
}
// this endpoint requires OAuth (access token)
if ($this->apiClient->getConfig()->getAccessToken() !== null) {
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
}

View File

@ -147,7 +147,7 @@ class StoreApi
// this endpoint requires API key authentication
$apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
if ($apiKey !== null) {
if (strlen($apiKey) !== 0) {
$headerParams['api_key'] = $apiKey;
}