6 ms·
Show HN: I just released Requests for PHP 1.6
- pwenzel 13y agoI really appreciate that the documentation includes a comparison to other libraries in this space, like Guzzle. Is there anything special to consider when using it with the Laravel framework?
- rmccue 13y ago> Is there anything special to consider when using it with the Laravel framework? Not that I'm aware of, you should be able to simply use it as a normal library.
- LukeShu 13y agoI read the HN title as "(Requests) for (PHP 1.6)", and wondered why someone would still be using PHP 1.6.
- brokenparser 13y agoThanks, I thought it was just me.
- misterjangles 13y agoI thought it was going to be a historical article about issues and features being considered in early PHP versions!
- dancecodes 13y agothe same here :) thinking thats about history
- neals 13y agoI thought it was a list of people requesting a PHP 1.6 binary to test for their outdated servers. Like, very cheap webhosts or something.
- mappu 13y agoIf there ever was a version 1.6, it's not on http://museum.php.net/ http://museum.php.net/ ..
- rmccue 13y agoHeh, thankfully I don't have to support PHP versions that old (although PHP 5.2 might as well be). It's called Requests for PHP to disambiguate it from Kenneth Reitz's fantastic Requests library in Python, which also serves to inspire my library.
- LukeShu 13y agoConsider yourself lucky, A year and a half ago I was supporting PHP 5.1. I wasn't confused by the title on the linked-to page, separating the version number from the name helped.
- julie1 13y agoPHP coded this way seems as sexy than java or c# without still the consistency of those languages. What is the advantage of using PHP now? The code is overbloated with complexity thus close to unmaintanable (evolution and correction) and there are stuff that feels wrong in my guts: https://github.com/rmccue/Requests/blob/master/library/Requests.php#L682 https://github.com/rmccue/Requests/blob/master/library/Reque... the naming is WRONG: flattening a list is not what he is doing: it is transforming a nested data structure in a level 1 associative array. Each wrong naming is a landmine waiting to explode at your face. This language now strikes me as an odd frankenstein that has no advantages anymore for coding. And this code is hiding its weakness in ridiculously complex OOP: every single methods are static for me it is the sign it should have been a namespace exporting functions.
- krapp 13y agoNot disputing or supporting your particular point about the style here, but problems with PHP as a language and problems with PHP as coded by a particular developer are two different things. Weirdly, people seem to ascribe the latter to the former rather often around here.
- julie1 13y agohum, the language as a 3rd important value that is undervaluated: culture! The language brings a culture and the efficiency of a language is indissociable from its average programming culture. The rant of torvalds against C++ for coding is not about the language but the culture of the developers. http://article.gmane.org/gmane.comp.version-control.git/57918 http://article.gmane.org/gmane.comp.version-control.git/5791... The same rant can be made on PHP and this code is just a very vivid example of this point. PHP is not a fractal of bad design, a language is primarily a media to convey ideas and concept from human to humans and actually if the culture of the users is sub level, whatever the quality of the language is the code will be shitty. PHP has attained a critical mass of ignorant developers that are dragging not only their whole language down but also of the whole eco system (managers, sysadmins...), so PHP is not only a bad language it is also a bad culture we should try to eradicate :)
- michaelmcmillan 13y agoYou're truly a life-saver! I ended up using Python today due to the lack of session handling in Requests-php. Thank you so much <3
- rmccue 13y agoNo worries, hope it works well for you! :)
- HNSucksAss 13y agoWho's still using PHP 1.6?
- pknight 13y agoWould love to see an example of Requests and the JSON api in WordPress, i.e. how would on go about making secure authenticated connections with a WordPress install through the JSON api. Is that in the works?
- rmccue 13y agoI see you've been following my projects. :) https://github.com/rmccue/WP-API-Client https://github.com/rmccue/WP-API-Client is an example of using Requests with the API (and the reference client fir the API), but it's not secure authentication, it's just a secure connection. The way to do that is to a) enable SSL on your site, and b) point the client to the HTTPS version of your site. That's all you need to use the security features in Requests.
- pknight 13y agoawesome, thank you!
- niteshade 13y agoLove this library, been using it a lot lately. Expect a PR from me in the near future :D