This is a skeleton class for PhpSecInfo tests You should extend this to make a "group" skeleton to categorize tests under, then make a subdir with your group name that contains test classes extending your group skeleton class.
Located in /PhpSecInfo/Test/Test.php (line 36)
Class | Description |
---|---|
PhpSecInfo_Test_Cgi | This is a skeleton class for PhpSecInfo "CGI" tests |
PhpSecInfo_Test_Core | This is a skeleton class for PhpSecInfo "Core" tests |
PhpSecInfo_Test_Curl | This is a skeleton class for PhpSecInfo "Curl" tests |
PhpSecInfo_Test_Session | This is a skeleton class for PhpSecInfo "Session" tests |
Enter description here...
This is the recommended value the test will be looking for
This value is used to group test results together.
For example, all tests related to the mysql lib should be grouped under "mysql."
This should be a unique, human-readable identifier for this test
the language code. Should be a pointer to the setting in the PhpSecInfo object
The message corresponding to the result of the test
This is a hash of messages that correspond to various test result levels.
There are five messages, each corresponding to one of the result constants (PHPSECINFO_TEST_RESULT_OK, PHPSECINFO_TEST_RESULT_NOTICE, PHPSECINFO_TEST_RESULT_WARN, PHPSECINFO_TEST_RESULT_ERROR, PHPSECINFO_TEST_RESULT_NOTRUN)
The result returned from the test
Constructor for Test skeleton class
This method converts the several possible return values from allegedly "boolean" ini settings to proper booleans
Properly converted input values are: 'off', 'on', 'false', 'true', '', '0', '1' (the last two might not be neccessary, but I'd rather be safe)
If the ini_value doesn't match any of those, the value is returned as-is.
returns the current value. This function should be used to access the value for display. All values are cast as strings
Returns a link to a page with detailed information about the test
URL is formatted as PHPSECINFO_TEST_MOREINFO_BASEURL + testName
returns the recommended value. This function should be used to access the value for display. All values are cast as strings
This just does the usual PHP string casting, except for the boolean FALSE value, where the string "0" is returned instead of an empty string
This retrieves the name of this test.
If a name has not been set, this returns a formatted version of the class name.
Returns an array of data returned from the UNIX 'id' command
includes uid, username, gid, groupname, and groups (if "exec" is enabled). Groups is an array of all the groups the user belongs to. Keys are the group ids, values are the group names.
returns FALSE if no suitable function is available to retrieve the data
Determines whether or not it's appropriate to run this test (for example, if this test is for a particular library, it shouldn't be run if the lib isn't loaded).
This is a terrible name, but I couldn't think of a better one atm.
A quick function to determine whether we're running on Windows.
Uses the PHP_OS constant.
This function takes the shorthand notation used in memory limit settings for PHP and returns the byte value. Totally stolen from http://us3.php.net/manual/en/function.ini-get.php
- echo 'post_max_size in bytes = ' . $this->return_bytes(ini_get('post_max_size'));
Sets the message for a given result code and language
- $this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', 'This test cannot be run');
sets the test group
sys_get_temp_dir provides some temp dir detection capability that is lacking in versions of PHP that do not have the sys_get_temp_dir() function
This is the wrapper that executes the test and sets the result code and message
The "meat" of the test. This is where the real test code goes. You should override this when extending
Placeholder - extend for tests
Sets the $this->_message variable based on the passed result and language codes
This function loads up result messages into the $this->_messages array.
Using this method rather than setting $this->_messages directly allows result messages to be inherited. This is broken out into a separate function rather than the constructor for ease of extension purposes (php4 is whack, man).
Sets the result code
Documentation generated on Fri, 06 Apr 2007 13:32:22 -0400 by phpDocumentor 1.3.0RC3