So, after an involuntary break I've pcked up work on CHttpClient again. Having missed the 1.1.13 release gave me the opportunity to meditate on the written code so far. Having done so (and having extended my research on Guzzle
, Requests for PHP
and the libcurl internals), I am now in the process of commencing a large-scale rewrite. The goal will be to allow a much nicer API allowing method chaining quite similar to CDbCommandBuilder etc. I also had to learn that I had been a bit naïve in regards to the complexity of cookie and header parsing, let alone efficient management of those. In this regard I'd like to fetch some input on how to solve the problem of header management as I certainly do not wish to copy the approach Zend Framework 2
Another hot topic is the usage of temporary PHP streams
. They were introduced in PHP 5.1 and are held in memory until they pass a certain threshold or the memory_limit is being hit, in which case they are dumped to the HDD. Temp streams are used heavily by Guzzle and they solve quite a lot of problems I earlier had. E.g. they make it far less dangerous to download files of unknown size. Unfortunately, they will also hamper interoperability with pecl::http and libcurl. We will see how well this goes.
Since I've found myself dealing with URL manipulations a lot more than anticipated, I see the need for a CUrl object arising. I heavily opposed that idea here
. Although that happened for different reasons, you know what they say about peopl who never change their oppinion
So, all in all this turns out to be a lot more work than I initialy thought. Mostly thanks to server quirks who are a lot harder to come by than client quirks
In the meantime, feel free to use Guzzle. It is ridiculously easy to set up with Yii and I expect the result of my work to be similar regarding API calls.