整合AWS SDK作为codeigniter库 [英] Integrating AWS SDK as a library in Codeigniter

查看:215
本文介绍了整合AWS SDK作为codeigniter库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

时已经有一个方便的Cl 2库AWS SDK 1.5.x的?如果没有,会是什么步骤,使之成为一个?

Is there already a handy CI 2 library for AWS SDK 1.5.x? If not, what would be the steps to make it into one?

我发现了一个3岁的发帖有关集成泰山(在pre-pre-光标移动到AWS SDK),以CI 1此处的 http://blog.myonepage.com/integrating-tarzan-amazon-web-services-php-to 。我想知道,如果这些指令仍持有?一个区别我注意到的是,在这样AWS SDK 1.5.3声明其访问标识符改变了,我不太清楚如何进行告知CI这一点。

I found a 3 year old posting about integrating Tarzan (the pre-pre-cursor to AWS SDK) to CI 1 here: http://blog.myonepage.com/integrating-tarzan-amazon-web-services-php-to. I am wondering if these instructions still hold? One difference I noticed was that the way AWS SDK 1.5.3 declares its Access Identifiers has changed and I am not quite sure how to proceed to inform CI about this.

谢谢! mmiz

推荐答案

您链接的博客文章基本上仍是有效的,这里的究竟是什么,你需要做的:

The blog post you linked is still basically valid, here's what exactly you need to do:

先放SDK到子文件夹内的库文件夹(前。AWS-SDK换PHP)。这是在库文件夹中的文件awslib.php:

First put SDK into subfolder inside libraries folder (for ex. aws-sdk-for-php). This is the file awslib.php in libraries folder:

class Awslib {

    function Awslib()
    {
        require_once('aws-sdk-for-php/sdk.class.php');
    }
}

然后就是使用任何AWS服务,你想在控制器,让我们说这是SQS:

And then just use whatever AWS service you wish in the controller, let's say it's SQS:

    $this->load->library('awslib');
    $sqs = new AmazonSQS();
    $response = $sqs->list_queues();
    var_dump($response->isOK());

不要忘记设置您的凭据,并重新命名示例配置文件。

Don't forget to set your credentials and rename the sample config file.

这篇关于整合AWS SDK作为codeigniter库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆