-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
48 changed files
with
2,182 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
samples/client/petstore-security-test/php/OpenAPIClient-php/.php_cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
return Symfony\CS\Config::create() | ||
->level(Symfony\CS\FixerInterface::PSR2_LEVEL) | ||
->setUsingCache(true) | ||
->fixers( | ||
[ | ||
'ordered_use', | ||
'phpdoc_order', | ||
'short_array_syntax', | ||
'strict', | ||
'strict_param' | ||
] | ||
) | ||
->finder( | ||
Symfony\CS\Finder\DefaultFinder::create() | ||
->in(__DIR__) | ||
); |
10 changes: 10 additions & 0 deletions
10
samples/client/petstore-security-test/php/OpenAPIClient-php/.travis.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
language: php | ||
sudo: false | ||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- hhvm | ||
before_install: "composer install" | ||
script: "vendor/bin/phpunit" |
112 changes: 112 additions & 0 deletions
112
samples/client/petstore-security-test/php/OpenAPIClient-php/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# OpenAPIClient-php | ||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- | ||
|
||
This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: | ||
|
||
- API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r | ||
- Build package: org.openapitools.codegen.languages.PhpClientCodegen | ||
|
||
## Requirements | ||
|
||
PHP 5.5 and later | ||
|
||
## Installation & Usage | ||
### Composer | ||
|
||
To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: | ||
|
||
``` | ||
{ | ||
"repositories": [ | ||
{ | ||
"type": "git", | ||
"url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" | ||
} | ||
], | ||
"require": { | ||
"GIT_USER_ID/GIT_REPO_ID": "*@dev" | ||
} | ||
} | ||
``` | ||
|
||
Then run `composer install` | ||
|
||
### Manual Installation | ||
|
||
Download the files and include `autoload.php`: | ||
|
||
```php | ||
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php'); | ||
``` | ||
|
||
## Tests | ||
|
||
To run the unit tests: | ||
|
||
``` | ||
composer install | ||
./vendor/bin/phpunit | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation procedure](#installation--usage) and then run the following: | ||
|
||
```php | ||
<?php | ||
require_once(__DIR__ . '/vendor/autoload.php'); | ||
|
||
$apiInstance = new OpenAPI\Client\Api\FakeApi( | ||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | ||
// This is optional, `GuzzleHttp\Client` will be used as default. | ||
new GuzzleHttp\Client() | ||
); | ||
$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // object | | ||
|
||
try { | ||
$apiInstance->testCodeInjectEndRnNR($unknown_base_type); | ||
} catch (Exception $e) { | ||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL; | ||
} | ||
|
||
?> | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*FakeApi* | [**testCodeInjectEndRnNR**](docs/Api/FakeApi.md#testcodeinjectendrnnr) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [ModelReturn](docs/Model/ModelReturn.md) | ||
|
||
|
||
## Documentation For Authorization | ||
|
||
|
||
## api_key | ||
|
||
- **Type**: API key | ||
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r | ||
- **Location**: HTTP header | ||
|
||
## petstore_auth | ||
|
||
- **Type**: OAuth | ||
- **Flow**: implicit | ||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog | ||
- **Scopes**: | ||
- **write:pets**: modify pets in your account *_/ ' \" =end -- \\r\\n \\n \\r | ||
- **read:pets**: read your pets *_/ ' \" =end -- \\r\\n \\n \\r | ||
|
||
|
||
## Author | ||
|
||
[email protected] *_/ ' \" =end -- \\r\\n \\n \\r | ||
|
||
|
38 changes: 38 additions & 0 deletions
38
samples/client/petstore-security-test/php/OpenAPIClient-php/composer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "GIT_USER_ID/GIT_REPO_ID", | ||
"description": "", | ||
"keywords": [ | ||
"openapitools", | ||
"openapi-generator", | ||
"php", | ||
"sdk", | ||
"rest", | ||
"api" | ||
], | ||
"homepage": "http://openapi-generator.tech", | ||
"license": "proprietary", | ||
"authors": [ | ||
{ | ||
"name": "OpenAPI-Generator contributors", | ||
"homepage": "https://openapi-generator.tech" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5", | ||
"ext-curl": "*", | ||
"ext-json": "*", | ||
"ext-mbstring": "*", | ||
"guzzlehttp/guzzle": "^6.2" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^4.8", | ||
"squizlabs/php_codesniffer": "~2.6", | ||
"friendsofphp/php-cs-fixer": "~1.12" | ||
}, | ||
"autoload": { | ||
"psr-4": { "OpenAPI\\Client\\" : "lib/" } | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { "OpenAPI\\Client\\" : "test/" } | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
samples/client/petstore-security-test/php/OpenAPIClient-php/docs/Api/FakeApi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# OpenAPI\Client\FakeApi | ||
|
||
All URIs are relative to *petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**testCodeInjectEndRnNR**](FakeApi.md#testCodeInjectEndRnNR) | **PUT** /fake | To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | ||
|
||
|
||
# **testCodeInjectEndRnNR** | ||
> testCodeInjectEndRnNR($unknown_base_type) | ||
To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | ||
|
||
### Example | ||
```php | ||
<?php | ||
require_once(__DIR__ . '/vendor/autoload.php'); | ||
|
||
$apiInstance = new OpenAPI\Client\Api\FakeApi( | ||
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. | ||
// This is optional, `GuzzleHttp\Client` will be used as default. | ||
new GuzzleHttp\Client() | ||
); | ||
$unknown_base_type = new \OpenAPI\Client\Model\UNKNOWN_BASE_TYPE(); // object | | ||
|
||
try { | ||
$apiInstance->testCodeInjectEndRnNR($unknown_base_type); | ||
} catch (Exception $e) { | ||
echo 'Exception when calling FakeApi->testCodeInjectEndRnNR: ', $e->getMessage(), PHP_EOL; | ||
} | ||
?> | ||
``` | ||
|
||
### Parameters | ||
|
||
Name | Type | Description | Notes | ||
------------- | ------------- | ------------- | ------------- | ||
**unknown_base_type** | [**object**](../Model/UNKNOWN_BASE_TYPE.md)| | [optional] | ||
|
||
### Return type | ||
|
||
void (empty response body) | ||
|
||
### Authorization | ||
|
||
No authorization required | ||
|
||
### HTTP request headers | ||
|
||
- **Content-Type**: application/json, *_/ \" =end -- | ||
- **Accept**: Not defined | ||
|
||
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) | ||
|
10 changes: 10 additions & 0 deletions
10
...s/client/petstore-security-test/php/OpenAPIClient-php/docs/Model/ModelReturn.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# ModelReturn | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**return** | **int** | property description *_/ ' \" =end -- \\r\\n \\n \\r | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
52 changes: 52 additions & 0 deletions
52
samples/client/petstore-security-test/php/OpenAPIClient-php/git_push.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/sh | ||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ | ||
# | ||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" | ||
|
||
git_user_id=$1 | ||
git_repo_id=$2 | ||
release_note=$3 | ||
|
||
if [ "$git_user_id" = "" ]; then | ||
git_user_id="GIT_USER_ID" | ||
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" | ||
fi | ||
|
||
if [ "$git_repo_id" = "" ]; then | ||
git_repo_id="GIT_REPO_ID" | ||
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" | ||
fi | ||
|
||
if [ "$release_note" = "" ]; then | ||
release_note="Minor update" | ||
echo "[INFO] No command line input provided. Set \$release_note to $release_note" | ||
fi | ||
|
||
# Initialize the local directory as a Git repository | ||
git init | ||
|
||
# Adds the files in the local repository and stages them for commit. | ||
git add . | ||
|
||
# Commits the tracked changes and prepares them to be pushed to a remote repository. | ||
git commit -m "$release_note" | ||
|
||
# Sets the new remote | ||
git_remote=`git remote` | ||
if [ "$git_remote" = "" ]; then # git remote not defined | ||
|
||
if [ "$GIT_TOKEN" = "" ]; then | ||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." | ||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git | ||
else | ||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git | ||
fi | ||
|
||
fi | ||
|
||
git pull origin master | ||
|
||
# Pushes (Forces) the changes in the local repository up to the remote repository | ||
echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" | ||
git push origin master 2>&1 | grep -v 'To https' | ||
|
Oops, something went wrong.