diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-07-05 03:34:42 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-07-05 03:34:42 -0700 |
commit | 9f7ae0e95f89b964a098eaacdfd89ff25e05c615 (patch) | |
tree | 0bfe8d04f4b11abdbea41fe9bf6e165eec8ebc4b /simplepie/demo/test.php | |
parent | f5826105bfc514599b2c5b6692bca14ca4bc5d78 (diff) | |
download | volse-hubzilla-9f7ae0e95f89b964a098eaacdfd89ff25e05c615.tar.gz volse-hubzilla-9f7ae0e95f89b964a098eaacdfd89ff25e05c615.tar.bz2 volse-hubzilla-9f7ae0e95f89b964a098eaacdfd89ff25e05c615.zip |
Add simplepie
Diffstat (limited to 'simplepie/demo/test.php')
-rw-r--r-- | simplepie/demo/test.php | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/simplepie/demo/test.php b/simplepie/demo/test.php new file mode 100644 index 000000000..5b9943abb --- /dev/null +++ b/simplepie/demo/test.php @@ -0,0 +1,62 @@ +<?php +include_once('../simplepie.inc'); +include_once('../idn/idna_convert.class.php'); + +// Parse it +$feed = new SimplePie(); +if (isset($_GET['feed']) && $_GET['feed'] !== '') +{ + if (get_magic_quotes_gpc()) + { + $_GET['feed'] = stripslashes($_GET['feed']); + } + $feed->set_feed_url($_GET['feed']); + $feed->enable_cache(false); + $starttime = explode(' ', microtime()); + $starttime = $starttime[1] + $starttime[0]; + $feed->init(); + $endtime = explode(' ', microtime()); + $endtime = $endtime[1] + $endtime[0]; + $time = $endtime - $starttime; +} +else +{ + $time = 'null'; +} + +$feed->handle_content_type(); + +?> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> +<title>SimplePie Test</title> +<pre> +<?php + +// memory_get_peak_usage() only exists on PHP 5.2 and higher if PHP is compiled with the --enable-memory-limit configuration option or on PHP 5.2.1 and higher (which runs as if --enable-memory-limit was on, with no option) +if (function_exists('memory_get_peak_usage')) +{ + var_dump($time, memory_get_usage(), memory_get_peak_usage()); +} +// memory_get_usage() only exists if PHP is compiled with the --enable-memory-limit configuration option or on PHP 5.2.1 and higher (which runs as if --enable-memory-limit was on, with no option) +else if (function_exists('memory_get_usage')) +{ + var_dump($time, memory_get_usage()); +} +else +{ + var_dump($time); +} + +// Output buffer +function callable_htmlspecialchars($string) +{ + return htmlspecialchars($string); +} +ob_start('callable_htmlspecialchars'); + +// Output +print_r($feed); +ob_end_flush(); + +?> +</pre>
\ No newline at end of file |