Add a composer.json configuration #29

Closed
wants to merge 2 commits into
from

Projects

None yet

5 participants

@rcambien

I added a composer.json file to integrate the SDK within projects that use Composer.

Composer allow quick and easy installation of libraries and take care of the autoloading system.

More info on the Composer website : http://getcomposer.org/

After this pull request, you can add the SDK to packagist, a repository for PHP libraries :

http://packagist.org/

Thanks.

@jeremeamia jeremeamia and 1 other commented on an outdated diff May 18, 2012
@@ -12,3 +12,4 @@ build
_tests
_vanity
*~
+/.idea/*
@jeremeamia
jeremeamia May 18, 2012 Contributor

Yay PhpStorm!

@rcambien
rcambien May 18, 2012

Sorry, I missed that one :(

@jeremeamia
Contributor

I love Composer, but I don't think the SDK is really compatible with it at this time due to how we currently handle bootstrapping. Was this composer json something that you tested with?

@rcambien

I use the SDK with composer on some projects.
I didn't try everything but the SimpleDB, DynamoDB, S3 and Cloudfront parts seems to work.

@jeremeamia
Contributor

Honestly, I'm kinda surprised that it works. We will discuss adding it and test it out though. We already have some future plans for integrating with Composer, but those aren't necessarily happening soon. So, thanks for submitting this. I'm going to leave this pull request open for a bit as a reminder to us, but when it comes time to actually do the work, we won't be able to merge the pull request in directly for logistical reasons.

I didn't try everything but the SimpleDB, DynamoDB, S3 and Cloudfront parts seems to work.

Are you using SimpleDB and DynamoDB in the same project? I'd be really interested in hearing that use case.

@rcambien

I migrate internal tools from SimpleDB to DynamoDB ... so it's the same project but not a the same time.

@rcambien

Maybe I can maintain my fork with composer and add the git repository to packagist so people can start include it in composer projects but it'll not have any official AWS support.

What do you think ?

@mbadolato

👍 For Composer support.

Even just something simple so that our packages can say that aws-sdk is a required file and it will download and include in a vendors dir.

Right now it's possible to do without an official composer.json file in the aws-sdk package, but it still requires some other configuration. An official composer file and listing at packagist.org would be great

@jeremeamia
Contributor

@rcambien My team will talk it over and see what we want to do.

@rcambien

If you want to give a try, you can use my repository.

Add this to your composer.json :

{
    "repositories": [
        {
            "type": "vcs",
            "url":  "git://github.com/rcambien/aws-sdk-for-php.git"
        }
    ],
    "require": {
        "amazonwebservices/aws-sdk-for-php": "1.5.*"
    }
}

I tag my repository with version 1.5.7.

Then, if you use the composer autoloader, everything should works without the need to include the sdk.class.php file.

I didn't try with the main config.inc.php file for authentification because I pass my keys directly in the constructor of each classes.

@jeremeamia
Contributor

Cool! Seems to works for me. We'll make a couple of tweaks and try to get this in our next release.

@jonathaningram

+1 Can't wait for out-of-the-box Composer support.

@jeremeamia
Contributor

Thanks for all the +1. I added a composer.json to version 1.5.7 and registered the package on packagist.org. Let me know if you have any problems, or if you have any composer.json tweaks that could benefit the package.

@jeremeamia jeremeamia closed this Jun 12, 2012
@rcambien

Cool, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment