From 2a83cc96dc9c2588c5f3ad02d73c59f2ab19c58b Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 8 Mar 2009 05:08:21 +0000 Subject: more work for alpha2 release, clean up install and debug a bit --- lib/debug.lib.php | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'lib/debug.lib.php') diff --git a/lib/debug.lib.php b/lib/debug.lib.php index 74d6d3ee..30efc8a7 100644 --- a/lib/debug.lib.php +++ b/lib/debug.lib.php @@ -79,6 +79,11 @@ function check_php_ver($level=0) { if (floatval(phpversion()) < 5.1) { return false; } + + // Poor windows users if only their OS wasn't behind the times + if (strtoupper(substr(PHP_OS,0,3)) == 'WIN' AND floatval(phpversion()) < 5.3) { + return false; + } // Make sure that they have the sha256() algo installed if (!function_exists('hash_algos')) { return false; } @@ -227,6 +232,34 @@ function check_putenv() { } // check_putenv +/** + * check_gettext + * This checks to see if you've got gettext installed + */ +function check_gettext() { + + if (!function_exists('gettext')) { + return false; + } + + return true; + +} // check_gettext + +/** + * check_mbstring + * This checks for mbstring support + */ +function check_mbstring() { + + if (!function_exists('mb_check_encoding')) { + return false; + } + + return true; + +} // check_mbstring + /** * generate_config * This takes an array of results and re-generates the config file @@ -272,4 +305,20 @@ function generate_config($current) { } // generate_config +/** + * debug_ok + * Return an "OK" with the specified string + */ +function debug_result($comment,$status=false,$value=false) { + + $class = $status ? 'ok' : 'notok'; + if (!$value) { + $value = $status ? 'OK' : 'ERROR'; + } + + $final = '' . scrub_out($value) . ' ' . scrub_out($comment) . ''; + + return $final; + +} // debug_ok ?> -- cgit