Source for file open_basedir.php

Documentation is available at open_basedir.php

  1. <?php
  2. /**
  3. * Test Class for open_basedir
  4. *
  5. * @package PhpSecInfo
  6. * @author Ed Finkler <coj@funkatron.com>
  7. */
  8.  
  9.  
  10. /**
  11. * require the PhpSecInfo_Test_Core class
  12. */
  13. require_once('PhpSecInfo/Test/Test_Core.php');
  14.  
  15. /**
  16. * Test Class for open_basedir
  17. *
  18. * @package PhpSecInfo
  19. */
  20. class PhpSecInfo_Test_Core_Open_Basedir extends PhpSecInfo_Test_Core
  21. {
  22.  
  23. /**
  24. * This should be a <b>unique</b>, human-readable identifier for this test
  25. *
  26. * @var string
  27. */
  28. var $test_name = "open_basedir";
  29.  
  30. var $recommended_value = TRUE;
  31.  
  32. function _retrieveCurrentValue() {
  33. $this->current_value = $this->getBooleanIniValue('open_basedir');
  34. }
  35. /**
  36. * Checks to see if allow_url_fopen is enabled
  37. *
  38. */
  39. function _execTest() {
  40. if ($this->current_value == $this->recommended_value) {
  41. return PHPSECINFO_TEST_RESULT_OK;
  42. }
  43.  
  44. return PHPSECINFO_TEST_RESULT_NOTICE;
  45. }
  46. /**
  47. * Set the messages specific to this test
  48. *
  49. */
  50. function _setMessages() {
  51. parent::_setMessages();
  52. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_OK, 'en', 'open_basedir is enabled, which is the
  53. recommended setting. Keep in mind that other web applications not written in PHP will not
  54. be restricted by this setting.');
  55. $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTICE, 'en', 'open_basedir is disabled. When
  56. this is enabled, only files that are in the
  57. given directory/directories and their subdirectories can be read by PHP scripts.
  58. You should consider turning this on. Keep in mind that other web applications not
  59. written in PHP will not be restricted by this setting.');
  60. }
  61.  
  62. }

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