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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SecurityInfo/PhpSecInfo/Test/Test_Cgi.php')
-rw-r--r--plugins/SecurityInfo/PhpSecInfo/Test/Test_Cgi.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/SecurityInfo/PhpSecInfo/Test/Test_Cgi.php b/plugins/SecurityInfo/PhpSecInfo/Test/Test_Cgi.php
new file mode 100644
index 0000000000..6843a59afa
--- /dev/null
+++ b/plugins/SecurityInfo/PhpSecInfo/Test/Test_Cgi.php
@@ -0,0 +1,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_name()) ) {
+ return true;
+ } else {
+ return false;
+ }*/
+ return strpos(php_sapi_name(), 'cgi') === 0;
+ }
+
+
+ /**
+ * 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");
+
+ }
+
+} \ No newline at end of file