themattharris/tmhOAuth — pull request #124 by erikaheidi (2013-04-02 19:23:30+00:00)
Title: new structure suggestion

hello there,
First of all, thanks for your great work with tmhOAuth!

I'm making this suggestions cause recently I had a lot of trouble to use composer properly with tmhOAuth, so I made some modifications to help with that.

I first started adding the namespace, so it would be possible to actually call tmOAuth as a require on composer.json and get the autoload provided by composer. The name used was "tmhOAuth", since it is currently registered in the PSR-0 declaration on composer.

As I got some problems with the name itself and the way composer is configured now, I had to made some changes with the structure, adding a "src" folder to use as PSR-0 and actually make the autoload work.

To be more library-style, I changed the name for tmhoauth/tmhoauth on composer.

and finally, I had to move cacert.pem to the src folder.

After this modifications, I was able to use this composer:

{
"repositories": [{
"type": "vcs",
"url": "https://github.com/erikaheidi/tmhOAuth.git"
}],
"require": {
"tmhoauth/tmhoauth": "dev-ttools"
}
}

And get \tmhOAuth\tmhOauth() inside my app, just by requiring the composer autoload.

I made this because I'm working in a project to write twitter apps in an easier way. I really want to use tmOAuth directly, so I hope this suggestion can help somehow for the nearly future - I'm sure it would make life easier for developers who want to use your library.