News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

IBuildings Blog:
Multithreading in PHP with CURL
0 comments :: posted Tuesday April 01, 2008 @ 16:23:08
voice your opinion now!

As mentioned on the Zend Developer Zone, there's a new tutorial posted on the IBuildings blog (by Lineke Kerckhoffs-Willems) about performing some multi-threading magic in PHP with the help of cURL.

Each PHP request is a separate thread. There are some workarounds like using pcntl_fork, starting multiple commandline php processes using the exec command or even using ajax. Another possibility is using the Curl library. Besides the basic functions described above Curl offers the "multi" functions for retrieving content from several url's at the same time.

Examples are included showing how to make these "multi" requests via PHP's cURL support (calling URLs with a "seconds" value on the end).

tagged with: multithread curl example tutorial multiple request


Stoyan Stefanov's Blog:
Simultaneous HTTP requests in PHP with cURL
0 comments :: posted Tuesday February 19, 2008 @ 09:34:00
voice your opinion now!

On his blog today, Stoyan Stefanov has a howto posted on a trick he figured out to get a PHP script to grab data from multiple resources at one time - with cURL.

The basic idea of a Web 2.0-style "mashup" is that you consume data from several services, often from different providers and combine them in interesting ways. This means you often need to do more than one HTTP request to a service or services. [...] Using the curl_multi* family of cURL functions you can make those requests simultaneously. This way your app is as slow as the slowest request, as opposed to the sum of all requests. And that's something.

He includes example code that loops through a given array of resources and executes the fetch, brining the results back into a result array. To illustrate, he also includes two types of examples of fetching content - one for GET and another for POST.

tagged with: curl simultaneous http request tutorial get post


zendframework cakephp mysql developer security application zend book PHP5 code release pecl job PEAR database releases framework conference ajax package

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework