phppro/sdk
最新稳定版本:1.5.3
Composer 安装命令:
composer require phppro/sdk
包简介
PHPPRO SDK
README 文档
README
This repository contains the PHP SDK and Symfony 2 SDK Bundle that allows you to access any API that conforms to PHPPRO's API rules.
Usage
Symfony 2 integration (SDK Bundle)
This version of the bundle requires Symfony 2.5+.
Installation
Installation is a quick 4 step process:
- Download phppro/sdk using composer
- Enable the Bundle
- Configure your application's security.yml
- Configure the SdkBundle
Step 1: Download phppro/sdk using composer
Add phppro/sdk dependency to your composer.json :
# composer.json
{
"require": {
"phppro/sdk": "1.*"
},
...
}
Then update:
$ php composer.phar update phppro/sdk
Composer will install the bundle to your project's vendor/phppro/sdk directory and additional required
packages.
Step 2: Enable the bundle
Enable the bundle in the kernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Phppro\Sdk\SdkBundle(), ); }
Step 3: Configure your application's security.yml
# app/config/security.yml security: encoders: phppro\Common\SdkBundle\Security\User\ApiUser: id: sdk.api.password_encoder role_hierarchy: ... providers: api: id: sdk.api.user_provider firewalls: ...
Step 4: Configure the phpproCommonSdkBundle
# app/config/config.yml phppro_common_sdk: host: "%api.host%" login: "%api.login%" password: "%api.password%" clientId: "%api.clientId%"
You can then add all the %api.*% parameters into your app/config/parameters.yml(.dist) :
# app/config/parameters.yml # contact phppro dev team to obtain the appropriate host name api.host: api.phppro.com # contact phppro dev team to obtain the appropriate login name api.login: mylogin # contact phppro dev team to obtain the appropriate password hash api.password: abcd1234... # contact phppro dev team to obtain the appropriate client id api.clientId: myclient
More bundle configuration parameters are available but optional (redis cache for token, ...)
Next Steps
Contact the phppro dev team for further information.
统计信息
- 总下载量: 577
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-27