You are here: Documentation » API Reference » SimplePie » set_stupidly_fast()
Table of Contents
set_stupidly_fast()
Description
class SimplePie { set_stupidly_fast ( [bool $set = false] ) }
Set options to make SimplePie as fast as possible. Forgoes a substantial amount of data sanitization in favor of speed, namely disabling enable_order_by_date(), remove_div(), strip_comments(), strip_htmltags(), strip_attributes(), and set_image_handler().
SimplePie protects against malicious feeds by sanitizing the data. If you don't trust the feeds that you're parsing, you should do your own data sanitization to avoid security issues. If you DO trust the feeds you're parsing, this shouldn't be an issue.
Availability
- Available since SimplePie 1.0.
Parameters
set
Whether to trade data cleanliness for raw speed.
Examples
Enable "Stupidly Fast" mode
$feed = new SimplePie(); $feed->set_feed_url('http://simplepie.org/blog/feed/'); $feed->set_stupidly_fast(true); $feed->init(); $feed->handle_content_type(); echo $feed->get_title();
Equivalent individual settings as set_stupidly_fast()
$feed = new SimplePie(); $feed->set_feed_url('http://simplepie.org/blog/feed/'); // All of the things that set_stupidly_fast() sets automatically. $feed->enable_order_by_date(false); $feed->remove_div(false); $feed->strip_comments(false); $feed->strip_htmltags(false); $feed->strip_attributes(false); $feed->set_image_handler(false); $feed->init(); $feed->handle_content_type(); echo $feed->get_title();
Override a specific setting from set_stupidly_fast()
$feed = new SimplePie(); $feed->set_feed_url('http://simplepie.org/blog/feed/'); // Set set_stupidly_fast(), then override one of the settings. $feed->set_stupidly_fast(true); $feed->enable_order_by_date(true); $feed->init(); $feed->handle_content_type(); echo $feed->get_title();
See Also
reference/simplepie/set_stupidly_fast.txt · Last modified: 2011/03/06 03:56 (external edit)