03.02.2014 Views

php|architect's Guide to Web Scraping with PHP - Wind Business ...

php|architect's Guide to Web Scraping with PHP - Wind Business ...

php|architect's Guide to Web Scraping with PHP - Wind Business ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PEAR::HTTP_Client ” 67<br />

}<br />

?><br />

$url = $client->key();<br />

$response = $client->current();<br />

Observing R equests<br />

Both HTTP_Request and HTTP_Client have attach and detach methods for adding and<br />

remo ving instances of HTTP_Request_Listener. This class implements the observer<br />

design pattern and serves <strong>to</strong> intercept events that occur during the process of transmitting<br />

a request and receiving a response. To create an observer, first create a class<br />

that extends HTTP_Request_Listener as sho wn belo w .<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!