cloudmunch / php-sdk-v1
PHP CloudMunch SDK
dev-master
2015-10-12 10:05 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-09-14 18:04:06 UTC
README
CloudMunch SDK for PHP 提供了用于 CloudMunch 插件开发的辅助类。
###下载 SDK 我们建议使用 Composer 作为包管理器。安装 SDK 所需的所有操作只需在您的 composer.json 文件中添加以下条目。
{ "require": { "cloudmunch/php-sdk-v1":"dev-master" } }
###用法 下面是一个示例插件代码
<?php require __DIR__ . '/vendor/autoload.php'; use CloudMunch\AppAbstract; class SampleApp extends AppAbstract{ public function process($processparameters) { //To read the input to the plugin $inputparameters = $processparameters['appInput']; $inputvalue = $inputparameters-> input1; //To get the credentials to any integration read the integration specific details //from the array $integrationdetails $integrationdetails = $processparameters['integrationdetails']; $username=$integrationdetails[username]; $password=$integrationdetails[password]; } } //LifeCycle methods of a plugin $sampleapp = new SampleApp(); $sampleapp->initialize(); $processInput=$sampleapp->getProcessInput(); $sampleapp->process($processInput); $sampleapp->performAppcompletion();
要编写一个适用于亚马逊网络服务的 CloudMunch 插件,您只需创建一个项目,composer.json 应该包含以下内容
{ "require": { "cloudmunch/php-sdk-v1":"dev-master", "aws/aws-sdk-php": "2.*" } }
插件可以通过以下方式获取亚马逊网络服务的凭证
public function process($processparameters) {
//To read the input to the plugin
$inputparameters = $processparameters['appInput'];
$region = $inputparameters-> region;
//Reading the credentials from SDK
$integrationdetails = $processparameters['integrationdetails'];
$accessKey=$integrationdetails[accessKey];
$secretKey=$integrationdetails[secretKey];
}
}