4 ms·
As much as I know everyone dislikes PHP, there's lots of people still working with it. I love Requests in Python, so I built Requests for PHP: http://requests.r
by rmccue 14y ago
As much as I know everyone dislikes PHP, there's lots of people still working with it. I love Requests in Python, so I built Requests for PHP: http://requests.ryanmccue.info/ http://requests.ryanmccue.info/
I have to agree with Kenneth's points, in that pragmatism should outweigh the theoretical points. For example, in PHP, using a class as a grouping for static methods is a bad idea. I agree to a point, but there's something to be said for the ability to do `Requests::get('http://google.com/)` http://google.com/)` versus all the crap you have to do with cURL. (Plus, it's always >90% test coverage, which I stick to religiously.)
- dave1010uk 14y agoIf autoloading namespaces or namespaced functions was possible then static classes wouldn't be needed and things like this would be commonplace: \Requests\get('http://google.com');
- antihero 14y agoAnother reminder of why in the fuck did they use the backslash character.
- rmccue 14y agoThat's true, and it's something that's being discussed on the PHP core mailing list. However, I support PHP 5.2 (pragmatic reasons; 5.2 is still used by a huge percentage of hosts), so I wouldn't be able to use that anyway.
- RegEx 14y agoI'll check this out. I use python at home but have to use PHP at work. Thanks :)
- antihero 14y agoA little nitpick. In your tutorial you do: $request = Requests::get(...); This should really be: $response = Requests::get(...); As you get a Response object back.