Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Test_Cgi.php « Test « PhpSecInfo « SecurityInfo « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1a4156a3f4df525bb9b11738a887551587c1b0ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
 * Skeleton Test class file for Cgi group
 *
 * @package PhpSecInfo
 * @author Ed Finkler <coj@funkatron.com>
 */

/**
 * require the main PhpSecInfo class
 */
require_once(PHPSECINFO_BASE_DIR.'/Test/Test.php');



/**
 * This is a skeleton class for PhpSecInfo "CGI" tests
 * @package PhpSecInfo
 */
class PhpSecInfo_Test_Cgi extends PhpSecInfo_Test
{

	/**
	 * This value is used to group test results together.
	 *
	 * For example, all tests related to the mysql lib should be grouped under "mysql."
	 *
	 * @var string
	 */
	var $test_group = 'CGI';



	/**
	 * "CGI" tests should only be run if we're running as a CGI.  The best way I could think of
	 * to test this was to preg against the php_sapi_name() return value.
	 *
	 * @return boolean
	 */
	function isTestable() {
		/*if ( preg_match('/^cgi.*$/', PHP_SAPI) ) {
			return true;
		} else {
			return false;
		}*/
		return !strncmp(PHP_SAPI, 'cgi', 3);
	}


	/**
	 * Set the messages for CGI tests
	 *
	 */
	function _setMessages() {
		parent::_setMessages();

		$this->setMessageForResult(PHPSECINFO_TEST_RESULT_NOTRUN, 'en', "You don't seem to be using the CGI SAPI");

	}

}