Integrating AWS SDK as a Library in Codeigniter
Is there already a handy CI 2 library for AWS SDK 1.5.x? If not, what would be the steps to turn them into one?
I found a 3 year post on Tarzan Integration (AWS SDK Preliminary Index) in CI 1 here: http://blog.myonepage.com/integrating-tarzan-amazon-web-services-php-to . I am wondering if these instructions persist? One of the differences I noticed was that the way the AWS SDK 1.5.3 announces that its access IDs have changed, and I'm not really sure how to continue informing CI about this.
Thank! mmiz
source to share
The blog post you linked is still mostly valid, here's what you need to do:
First place the SDK in a subdirectory folder inside the library (e.g. aws-sdk-for-php). This is the awslib.php file in the libraries folder:
class Awslib {
function Awslib()
{
require_once('aws-sdk-for-php/sdk.class.php');
}
}
And then just use whatever AWS service you need in the controller, say SQS:
$this->load->library('awslib');
$sqs = new AmazonSQS();
$response = $sqs->list_queues();
var_dump($response->isOK());
Don't forget to provide your credentials and rename the sample config file.
source to share