Skip to content
j-norwood-young edited this page Nov 17, 2010 · 7 revisions

This library is an abstraction layer for integrating with multiple CDNs, primarily AWS S3 and Rackspace Cloudfiles, specifically formatted for CodeIgniter.

Requirements

  • Rackspace and/or Amazon PHP API
  • PHP 5
  • CodeIgniter
  • PHP Curl

The library is configured to find the API's under ./resources/cloud_services/cloudfiles/ for Rackspace and ./resources/cloud_services/aws/sdk.class.php for Amazon.

Authentication

You can set the following in a config file in CodeIgniter: //Rackspace credentials $config["rackspace_api_key"]="Your API Key"; $config["rackspace_username"]="Your Username";

//Amazon credentials
$config["aws_key"]="Your AWS key";
$config["aws_secret_key"]="Your super-secret Amazon key";

//Choose between Rackspace and Amazon
//You can use Amazon, AWS or S3 for Amazon. For Rackspace, set it to rackspace.
$config["cdn_service"]="aws";

Alternatively you can pass the credentials on init(), and set the cdn_service on object creation.

Known Bugs

There are still some bugs and the Amazon interface is particularly slow. Both Rackspace's and Amazon's PHP libraries are terribly buggy, which doesn't help matters.

Bug fix for Rackspace

cloudfiles_http.php +- line 230

$url_path = $this->_make_path("CDN")."/?enabled_only=true"; //Change this line

Roadmap

The next thing to add is error reporting.

I'm using this library in 10Layer, so it'll get whatever features I need. If there's something you want, or you just want to let me know you're using it, or you've got a fix or something, just mail me.

Contact

Jason Norwood-Young

[email protected]

http://www.10layer.com

License

This library is Copyright 2010 Jason Norwood-Young and 10Layer Software Development Pty (Ltd)

It is licensed under the MIT License (available with the source code) so please feel free to use it in your commercial and non-commercial projects, just keep the copyright notice and license with the library.

Clone this wiki locally