dexamped//kohana-aws

Kohana 对 aws-php-sdk 的包装。

安装次数: 3,967

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 4

开放问题: 1

类型:kohana-module

dev-3.3/master 2015-05-22 06:03 UTC

This package is not auto-updated.

Last update: 2024-09-28 18:05:15 UTC


README

Amazon AWS PHP SDK 的 Kohana 包装模块。

  1. 安装
  2. 使用方法

安装

安装模块

git submodule add git@github.com:dexamped/kohana-aws.git modules/kohana-aws
git submodule update --init --recursive

加载依赖

我们必须通过运行 composer install 安装供应商的依赖项。

composer install --working-dir=modules/kohana-aws/vendor/aws-sdk-php/

配置

编辑 application/bootstrap.php 并添加模块

Kohana::modules(array(
    ...
    'aws' => 'modules/kohana-aws',
    ...
));

modules/kohana-aws/config/aws.php 复制到 APPPATH/config/aws.php 并设置您的配置。

使用方法

<?php

class Controller_Amazon extends Controller {

	public function action_index()
	{
		// List some S3 buckets
		$s3 = Amazon::instance()->get('s3');

		// Execute an S3 method
		$result = $s3->listBuckets();

		// Do something with it here
	}
}
?>

完整 AWS SDK 使用

http://docs.aws.amazon.com/aws-sdk-php/latest/