Welcome Guest, Not a member yet? Register   Sign In
How to use Amazon s3 in Codeigniter?
#1

[eluser]tk123[/eluser]
I know there are a lot of CI libraries created to work with s3 but I would like to use the native PHP SDK released by amazon instead.

It works just fine when I use it outside CI, that is I am able to create buckets, upload files to them, etc. But when I put it inside CI and call it like so in my home controller:

Code:
require_once 'sdk-1.5.6.2/sdk.class.php';
$s3 = new AmazonS3();

I get the error:
Quote:Fatal error: Class 'AmazonS3' not found in /var/www/application/controllers/home.php on line 26

Same issue if I use the SDK as a CI Library. Does anyone know how to get this to work?
#2

[eluser]kanjimaster[/eluser]
Linuxjuggler has a spark that uses the Amazon's PHP SDK. You can see how he integrates it on github.
#3

[eluser]tk123[/eluser]
[quote author="kanjimaster" date="1339273443"]Linuxjuggler has a spark that uses the Amazon's PHP SDK. You can see how he integrates it on github.[/quote]

This looks promising but how do I get the
Code:
$this->load->spark()
function to work, I get this error:

Quote:Fatal error: Call to undefined method CI_Loader:Confusedpark() in /var/www/application/controllers/home.php on line 26
#4

[eluser]PhilTem[/eluser]
You will need CodeIgniter sparks to run

Code:
$this->load->spark()

which you can get more info on at

http://getsparks.org

But I think you should be able to use the S3-Library without sparks as well. There should be some documentation on its GH page
#5

[eluser]tk123[/eluser]
Thanks guys, I got Linuxjuggler's code to work as a standard library without using spark.
#6

[eluser]scriptigniter[/eluser]
Hey, you can use this library http://codecanyon.net/item/codeigniter-a...ry/4993914 to integrate S3 in Codeigniter. It is awesome library and makes the thing easy. you just need to call one function to use this. And the best part is it usages the original latest AWS PHP sdk provided by AWS in this.




Theme © iAndrew 2016 - Forum software by © MyBB