diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java index 1046add66ec..ed9e346c31f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PhpClientCodegen.java @@ -223,6 +223,8 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig { supportingFiles.add(new SupportingFile("ObjectSerializer.mustache", toPackagePath(invokerPackage, srcBasePath), "ObjectSerializer.php")); supportingFiles.add(new SupportingFile("composer.mustache", getPackagePath(), "composer.json")); supportingFiles.add(new SupportingFile("autoload.mustache", getPackagePath(), "autoload.php")); + supportingFiles.add(new SupportingFile("README.mustache", getPackagePath(), "README.md")); + supportingFiles.add(new SupportingFile(".travis.yml", getPackagePath(), ".travis.yml")); } @Override diff --git a/modules/swagger-codegen/src/main/resources/php/.travis.yml b/modules/swagger-codegen/src/main/resources/php/.travis.yml new file mode 100644 index 00000000000..3c97d942552 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "phpunit lib/Tests" diff --git a/modules/swagger-codegen/src/main/resources/php/README.mustache b/modules/swagger-codegen/src/main/resources/php/README.mustache new file mode 100644 index 00000000000..65d449d95c4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/php/README.mustache @@ -0,0 +1,47 @@ +# {{packagePath}} + +## Requirements + +PHP 5.4.0 and later + +## Installation & Usage +### Composer + +You can install the bindings via [Composer](http://getcomposer.org/). Add this to your `composer.json`: + +``` +{ + "repositories": [ + { + "type": "git", + "url": "https://github.com/YOUR_GITHUB_ID/{{packagePath}}.git" + } + ], + "require": { + "{{composerVendorName}}/{{composerPackageName}}": "*@dev" + } +} +``` + +Then install via `composer install` + +### Manual Installation + +If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the `{{packagePath}}.php` file. +```php + require_once('/path/to/{{packagePath}}/autoload.php'); +``` + +## Tests + +To run the unit tests: +``` +composer install +./vendor/bin/phpunit lib/Tests +``` + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} +