summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-05-12 15:44:43 +0000
committerxue <>2006-05-12 15:44:43 +0000
commit11d73dbdaa93742548a59f395f6279c91e7cfc1b (patch)
tree5aeaca010317f262baf4fc7c066fa56d71250673
parent7c97bdfd2b7b2450d4845631a80b04555f8e30c2 (diff)
Added more requirement checks.
-rw-r--r--requirements/index.php76
-rw-r--r--requirements/messages-zh.txt10
-rw-r--r--requirements/messages.txt10
3 files changed, 84 insertions, 12 deletions
diff --git a/requirements/index.php b/requirements/index.php
index b97cb515..38f9bc07 100644
--- a/requirements/index.php
+++ b/requirements/index.php
@@ -30,15 +30,70 @@
* @var array List of requirements (required or not, check item, hint)
*/
$requirements = array(
- array(true,'version_compare(PHP_VERSION,"5.0.4",">=")','PHP version check','PHP 5.0.4 or higher required'),
- array(false,'version_compare(PHP_VERSION,"5.1.0",">=")','PHP version check','PHP 5.1.0 or higher preferred'),
- array(true,'class_exists("DOMDocument",false)','DOM extension check','DOM extension required'),
- array(false,'function_exists("iconv")','ICONV extension check','ICONV extension optional'),
- array(false,'extension_loaded("zlib")','Zlib extension check','Zlib extension optional'),
- array(false,'extension_loaded("sqlite")','SQLite extension check','SQLite extension optional'),
- array(false,'extension_loaded("memcache")','Memcache extension check','Memcache extension optional'),
- array(false,'extension_loaded("apc")','APC extension check','APC extension optional'),
- array(false,'extension_loaded("mcrypt")','Mcrypt extension check','Mcrypt extension optional'),
+ array(
+ true,
+ version_compare(PHP_VERSION,"5.0.4",">="),
+ 'PHP version check',
+ 'PHP 5.0.4 or higher required'),
+ array(
+ false,
+ version_compare(PHP_VERSION,"5.1.0",">="),
+ 'PHP version check','PHP 5.1.0 or higher preferred'),
+ array(
+ true,
+ isset($_SERVER["HTTP_ACCEPT"]),
+ '$_SERVER["HTTP_ACCEPT"] check',
+ 'HTTP_ACCEPT required'),
+ array(
+ true,
+ isset($_SERVER["SCRIPT_FILENAME"]) && realpath($_SERVER["SCRIPT_FILENAME"])===realpath(__FILE__),
+ '$_SERVER["SCRIPT_FILENAME"] check',
+ 'SCRIPT_FILENAME required'),
+ array(
+ true,
+ isset($_SERVER["REQUEST_URI"]) || isset($_SERVER["QUERY_STRING"]),
+ '$_SERVER["REQUEST_URI"] check',
+ 'REQUEST_URI required'),
+ array(
+ true,
+ isset($_SERVER["PATH_INFO"]) || strpos($_SERVER["PHP_SELF"],$_SERVER["SCRIPT_NAME"])===0,
+ '$_SERVER["PATH_INFO"] check',
+ 'PATH_INFO required'),
+ array(
+ true,
+ class_exists("DOMDocument",false),
+ 'DOM extension check',
+ 'DOM extension required'),
+ array(
+ false,
+ function_exists("iconv"),
+ 'ICONV extension check',
+ 'ICONV extension optional'),
+ array(
+ false,
+ extension_loaded("zlib"),
+ 'Zlib extension check',
+ 'Zlib extension optional'),
+ array(
+ false,
+ extension_loaded("sqlite"),
+ 'SQLite extension check',
+ 'SQLite extension optional'),
+ array(
+ false,
+ extension_loaded("memcache"),
+ 'Memcache extension check',
+ 'Memcache extension optional'),
+ array(
+ false,
+ extension_loaded("apc"),
+ 'APC extension check',
+ 'APC extension optional'),
+ array(
+ false,
+ extension_loaded("mcrypt"),
+ 'Mcrypt extension check',
+ 'Mcrypt extension optional'),
);
$results = "<table class=\"result\">\n";
@@ -46,7 +101,8 @@ $conclusion = 0;
foreach($requirements as $requirement)
{
list($required,$expression,$aspect,$hint)=$requirement;
- eval('$ret='.$expression.';');
+ //eval('$ret='.$expression.';');
+ $ret=$expression;
if($required)
{
if($ret)
diff --git a/requirements/messages-zh.txt b/requirements/messages-zh.txt
index 3527a1ce..a64caebe 100644
--- a/requirements/messages-zh.txt
+++ b/requirements/messages-zh.txt
@@ -17,4 +17,12 @@ DOM extension required = DOM模块是必须的。如果它不存在,基于XML
ICONV extension check = ICONV模块检查
ICONV extension optional = ICONV模块是可选的。如果它不存在,某些国际化控件将无法正常工作。
Mcrypt extension check = Mcrypt模块检查
-Mcrypt extension optional = Mcrypt模块是可选的。如果它不存在,某些敏感数据,例如viewstate,将无法被加密。 \ No newline at end of file
+Mcrypt extension optional = Mcrypt模块是可选的。如果它不存在,某些敏感数据,例如viewstate,将无法被加密。
+$_SERVER["HTTP_ACCEPT"] check = $_SERVER["HTTP_ACCEPT"]检查
+HTTP_ACCEPT required = $_SERVER["HTTP_ACCEPT"]是必须的。如果它不存在,一些多语言功能可能出错。
+$_SERVER["SCRIPT_FILENAME"] check = $_SERVER["SCRIPT_FILENAME"]检查
+SCRIPT_FILENAME required = $_SERVER["SCRIPT_FILENAME"]必须指向本程序文件路径。
+$_SERVER["REQUEST_URI"] check = $_SERVER["REQUEST_URI"]检查
+REQUEST_URI required = $_SERVER["REQUEST_URI"]或$_SERVER["QUERY_STRING"]是必须的。如果它们都不存在,用户请求将无法被正确解析。
+$_SERVER["PATH_INFO"] check = $_SERVER["PATH_INFO"]检查
+PATH_INFO required = $_SERVER["PATH_INFO"]或$_SERVER["PHP_SELF"]和$_SERVER["SCRIPT_NAME"]是必须的。如果它们都不存在,URL的pathinfo将无法被正确解析。 \ No newline at end of file
diff --git a/requirements/messages.txt b/requirements/messages.txt
index 029806dc..83c50dbb 100644
--- a/requirements/messages.txt
+++ b/requirements/messages.txt
@@ -17,4 +17,12 @@ DOM extension required = DOM extension is required by PRADO. It is used in TX
ICONV extension check = ICONV extension check
ICONV extension optional = ICONV extension is optional. If it is absent, some internationalization components may not work properly.
Mcrypt extension check = Mcrypt extension check
-Mcrypt extension optional = Mcrypt extension is optional. If it is absent, sensitive data, such as viewstate, cannot be encrypted. \ No newline at end of file
+Mcrypt extension optional = Mcrypt extension is optional. If it is absent, sensitive data, such as viewstate, cannot be encrypted.
+$_SERVER["HTTP_ACCEPT"] check = $_SERVER["HTTP_ACCEPT"] check
+HTTP_ACCEPT required = $_SERVER["HTTP_ACCEPT"] is required by multilanguage support.
+$_SERVER["SCRIPT_FILENAME"] check = $_SERVER["SCRIPT_FILENAME"] check
+SCRIPT_FILENAME required = $_SERVER["SCRIPT_FILENAME"] must point to the file path of this checker script.
+$_SERVER["REQUEST_URI"] check = $_SERVER["REQUEST_URI"] check
+REQUEST_URI required = Either $_SERVER["REQUEST_URI"] or $_SERVER["QUERY_STRING"] must be available for resolving user requests.
+$_SERVER["PATH_INFO"] check = $_SERVER["PATH_INFO"] check
+PATH_INFO required = $_SERVER["PATH_INFO"] or $_SERVER["PHP_SELF"] and $_SERVER["SCRIPT_NAME"] are required for determining URL pathinfo.