add readme and travis

This commit is contained in:
wing328 2016-02-19 22:08:58 +08:00
parent 9ecea4b1f8
commit bb59ad95cf
3 changed files with 59 additions and 0 deletions

View File

@ -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

View File

@ -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"

View File

@ -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}}