Developers

License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release 0.9.3 - 16/02/2007

Release 0.9.2 - 09/02/2007

Release 0.9.1 - 08/02/2007

Release 0.9.0 - 08/02/2007

sfWebBrowser plugin

The sfWebBrowserPlugin proposes an HTTP client capable of making web requests. The interface is similar to that of sfTestBrowser.

Possible uses

Querying a Web service

Monitoring a Website

Mashup of content from several websites

Aggregation of RSS feeds

Proxy to another server

Cross-domain AJAX interactions

API to foreign websites

...

Contents

This plugin contains four classes: sfWebBrowser, sfFopenAdapter, sfCurlAdapter, and sfSocketsAdapter. Unit tests are available in the SVN repository, to be placed in a symfony application's test/ directory.

Gzip and deflate content-encoded response bodies are also supported, provided that you have the zlib extention enabled.

Adapters

The browser can use various adapters to perform the requests:

sfFopenAdapter (default): Uses fopen() to fetch pages. fopen() can take an URL as a parameter provided that PHP is compiled with sockets support, and allow_url_fopen is defined to true in php.ini. This is the case in most PHP distributions, so the default adapter should work in almost every platform. On the other hand, the compatibility has a cost: this adapter is slow.

sfCurlAdapter: Uses Curl to fetch pages. This adapter is a lot faster than sfFopenAdapter, however PHP must be compiled with the with-curl option, and the curl extension must be enabled in php.ini (which is rarely the case by default) for it to work.