Source for file Test_Cgi.php

Documentation is available at Test_Cgi.php

  1. <?php
  2. /**
  3. * Skeleton Test class file for Cgi group
  4. *
  5. * @package PhpSecInfo
  6. * @author Ed Finkler <coj@funkatron.com>
  7. */
  8.  
  9. /**
  10. * require the main PhpSecInfo class
  11. */
  12. require_once('PhpSecInfo/Test/Test.php');
  13.  
  14.  
  15.  
  16. /**
  17. * This is a skeleton class for PhpSecInfo "CGI" tests
  18. * @package PhpSecInfo
  19. */
  20. class PhpSecInfo_Test_Cgi extends PhpSecInfo_Test
  21. {
  22.  
  23. /**
  24. * This value is used to group test results together.
  25. *
  26. * For example, all tests related to the mysql lib should be grouped under "mysql."
  27. *
  28. * @var string
  29. */
  30. var $test_group = 'CGI';
  31.  
  32.  
  33.  
  34. /**
  35. * "CGI" tests should only be run if we're running as a CGI. The best way I could think of
  36. * to test this was to preg against the php_sapi_name() return value.
  37. *
  38. * @return boolean
  39. */
  40. function isTestable() {
  41. /*if ( preg_match('/^cgi.*$/', php_sapi_name()) ) {
  42. return true;
  43. } else {
  44. return false;
  45. }*/
  46. return strpos(php_sapi_name(), 'cgi') === 0;
  47. }
  48.  
  49.  
  50. /**
  51. * Set the messages for CGI tests
  52. *
  53. */
  54. function _setMessages() {
  55. parent::_setMessages();
  56.  
  57. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', "You don't seem to be using the CGI SAPI");
  58.  
  59. }
  60.  
  61. }

Documentation generated on Mon, 26 Feb 2007 10:50:07 -0500 by phpDocumentor 1.3.0RC3