From 6126b0a4e03d55617aaf5e7f0f808663106cbc99 Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Tue, 5 Sep 2023 22:39:44 +0200 Subject: Test simplepie --- test/sp_test.php | 496 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 496 insertions(+) create mode 100644 test/sp_test.php (limited to 'test') diff --git a/test/sp_test.php b/test/sp_test.php new file mode 100644 index 000000000..eae94828d --- /dev/null +++ b/test/sp_test.php @@ -0,0 +1,496 @@ +=')); +$pcre_ok = extension_loaded('pcre'); +$curl_ok = function_exists('curl_exec'); +$zlib_ok = extension_loaded('zlib'); +$mbstring_ok = extension_loaded('mbstring'); +$iconv_ok = extension_loaded('iconv'); +$intl_ok = version_compare(phpversion(), '5.5.0', '>=') && extension_loaded('intl'); +if (extension_loaded('xmlreader')) +{ + $xml_ok = true; +} +elseif (extension_loaded('xml')) +{ + $parser_check = xml_parser_create(); + xml_parse_into_struct($parser_check, '&', $values); + xml_parser_free($parser_check); + $xml_ok = isset($values[0]['value']); +} +else +{ + $xml_ok = false; +} + + + +if( php_sapi_name() === 'cli' ): + +$testHeader = << + + + +SimplePie: Server Compatibility Test + + + + + + + + + +
+
+ +
+

SimplePie Compatibility Test

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TestShould BeWhat You Have
PHP5.6.0 or higher
XMLEnabled
PCRE¹Enabled
cURLEnabled
ZlibEnabled
mbstringEnabled
iconvEnabled
+
+ +
+

What does this mean?

+
    + +
  1. You have everything you need to run SimplePie properly! Congratulations!
  2. + + +
  3. PHP: You are running a supported version of PHP. No problems here.
  4. + +
  5. XML: You have XMLReader support or a version of XML support that isn't broken installed. No problems here.
  6. + +
  7. PCRE: You have PCRE support installed. No problems here.
  8. + +
  9. cURL: You have cURL support installed. No problems here.
  10. + +
  11. cURL: The cURL extension is not available. SimplePie will use fsockopen() instead.
  12. + + + +
  13. Zlib: You have Zlib enabled. This allows SimplePie to support GZIP-encoded feeds. No problems here.
  14. + +
  15. Zlib: The Zlib extension is not available. SimplePie will ignore any GZIP-encoding, and instead handle feeds as uncompressed text.
  16. + + + +
  17. mbstring and iconv: You have both mbstring and iconv installed! This will allow SimplePie to handle the greatest number of languages. Check the Supported Character Encodings chart to see what's supported on your webhost.
  18. + +
  19. mbstring: mbstring is installed, but iconv is not. Check the Supported Character Encodings chart to see what's supported on your webhost.
  20. + +
  21. iconv: iconv is installed, but mbstring is not. Check the Supported Character Encodings chart to see what's supported on your webhost.
  22. + +
  23. mbstring and iconv: You do not have either of the extensions installed. This will significantly impair your ability to read non-English feeds, as well as even some English ones. Check the Supported Character Encodings chart to see what's supported on your webhost.
  24. + + +
  25. PCRE: Your PHP installation doesn't support Perl-Compatible Regular Expressions. SimplePie is a no-go at the moment.
  26. + + +
  27. XML: Your PHP installation doesn't support XML parsing. SimplePie is a no-go at the moment.
  28. + + +
  29. PHP: You are running an unsupported version of PHP. SimplePie is a no-go at the moment.
  30. + + +
+
+ +
+ +

Bottom Line: Yes, you can!

+

Your webhost has its act together!

+

You can download the latest version of SimplePie from SimplePie.org and install it by following the instructions. You can find example uses with SimplePie Ideas.

+

Take the time to read Requirements and Getting Started to make sure you're prepared to use SimplePie. No seriously, read them.

+

Note: Passing this test does not guarantee that SimplePie will run on your webhost — it only ensures that the basic requirements have been addressed.

+ +

Bottom Line: Yes, you can!

+

For most feeds, it'll run with no problems. There are certain languages that you might have a hard time with though.

+

You can download the latest version of SimplePie from SimplePie.org and install it by following the instructions. You can find example uses with SimplePie Ideas.

+

Take the time to read Requirements and Getting Started to make sure you're prepared to use SimplePie. No seriously, read them.

+

Note: Passing this test does not guarantee that SimplePie will run on your webhost — it only ensures that the basic requirements have been addressed.

+ +

Bottom Line: We're sorry…

+

Your webhost does not support the minimum requirements for SimplePie. It may be a good idea to contact your webhost, and ask them to install a more recent version of PHP as well as the xmlreader, xml, mbstring, iconv, curl, and zlib extensions.

+ +
+ +
+

¹ — Some recent versions of the PCRE (PERL-Compatible Regular Expression) engine compiled into PHP have been buggy, and are the source of PHP segmentation faults (e.g. crashes) which cause random things like blank, white screens. Check the Support Forums for the latest information on patches and ongoing fixes.

+
+ +
+ +
+ + + -- cgit v1.2.1