-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We need namespace! #39
Conversation
Hmmm maybe it ain't the correct namespace but please add one. ;) |
At least, this library need to be autoloaded following PSR-0 namespace conventions or either prefix conventions. |
I'm interested in the motivation behind adhering to PSR-0 and including namespaces while PHP 5.2 is still so widely used. |
Ok folks, you can use this lib without adding anything, even with Composer, and/or a namespaced environment. The default NS is Extract of my {
"require": {
"php": ">=5.3.2",
"themattharris/thm-oauth": "0.0.61"
},
"repositories": {
"tmh-oauth": {
"type": "package",
"package": {
"name": "themattharris/thm-oauth",
"version": "0.0.61",
"dist": {
"url": "https://github.com/themattharris/tmhOAuth/zipball/v0.61",
"type": "zip"
},
"source": {
"url": "https://github.com/themattharris/tmhOAuth.git",
"type": "git",
"reference": "v0.61"
}
}
}
}
} I guess you can add a @themattharris to provide a @kud be fair, and don't add yourself to the authors list ;) |
@willdurand you're right for Composer but the main idea was to benefit from PHP 5.3 features maybe with creating a dedicated branch for this library rather than replacing it for < PHP 5.2.
Yes please do that ! I'm inviting you to read the Composer documentation in order to do so. |
@willdurand Wait wait wait Will. I think there's a mistake in my merge. If I added me in authors list, it's onlye because I'm working on a restructuration of all the lib, available here; https://github.com/kud/tmhoauth (it's not finished), and I prefer that people come back to me if there's a composer mistake, but in any case I wanted to say it's my lib. For sure. In fact, I'm working on the silex service provider (https://github.com/kud/tmhoauth-silex-service-provider) of this lib and I think I need to change the paths of the lib to respect PSR-0. But maybe yeah I'm wrong? |
@themattharris Composer is a new dependency manager for PHP. It allows you to specify dependencies on a per-project basis. It takes lots of inspiration from NPM and ruby's bundler. All you need to support composer is a composer.json file. In order to allow easy installation, the repository needs to be added to packagist, which is the standard repository for composer. Packagist will fetch all the versions from your github repository tags. Once it has been added, adding tmhOAuth to a project will be as easy as creating this composer.json file in the project's directory:
And running this command:
Note: Packagist will re-crawl github for new versions all the time. After submitting it once, you don't have to do anything else. Check out the following information on composer and packagist:
@dguyon to have a PHP 5.3 compliant lib definitely makes sense, that's right. @kud yeah, looks better on your own fork right, my apologies then. Didn't see you've worked a lot. Nice to see a Silex Provider for this lib btw, good job! |
@willdurand No problem, I'll finish it soon as possible and will try to do a pull request but I could understand that @themattharris doesn't approve all these modifications. ;) |
+1 on including the composer file btw :-) |
i'm going to tackle this on 0.7.1. |
…leinespel, dguyon, kud, philsturgeon, willdurand
- use DIRECTORY_SEPARATOR for multi-environment support. (Issue #80) Props: whallz - tidied up the curlHeader function to use explode instead of substr and store the keys in the format they are returned from the API - removed content-length hack as it isn't needed if CURLOPT_POSTFIELDS is initialized on all POSTs - removed the expects header hack as Twitter no longer requires it to be there - introduce composer.json. (Issues #39, #77, #85) Props: akandels, conradkleinespel, dguyon, kud, philsturgeon, willdurand - added support for specifying custom headers when using $tmhOAuth->request. (Issue #98)
No description provided.