This commit is contained in:
Miles Lott 2004-02-03 06:21:25 +00:00
parent 8c301efe44
commit ac1c6a1845

View File

@ -11,10 +11,10 @@
/* $Id$ */
$run_by_webserver = !!$_SERVER['PHP_SELF'];
$run_by_webserver = !!$_SERVER['PHP_SELF'];
if ($run_by_webserver)
{
if ($run_by_webserver)
{
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
@ -37,14 +37,14 @@ if ($run_by_webserver)
$passed_icon = '<img src="templates/default/images/completed.png" title="Passed" align="middle"> ';
$error_icon = '<img src="templates/default/images/incomplete.png" title="Error" align="middle"> ';
$warning_icon = '<img src="templates/default/images/dep.png" title="Warning" align="middle"> ';
}
else
{
}
else
{
$passed_icon = ' Passed';
$error_icon = '*** Error: ';
$warning_icon = '!!! Warning: ';
}
$checks = array(
}
$checks = array(
'safe_mode' => array(
'func' => 'php_ini_check',
'value' => 0,
@ -53,7 +53,7 @@ $checks = array(
If safe_mode is turned on, eGW is not able to change certain settings on runtime, nor can we load any not yet loaded module.
*** You have to do the changes manualy in your php.ini (usualy in /etc on linux) in order to get eGW fully working !!!
*** Do NOT update your database via setup, as the update might be interrupted by the max_execution_time,
which leaves your DB in an unrecoverable state (your data is lost) !!!'
which leaves your DB in an unrecoverable state (your data is lost) !!!'
),
'error_reporting' => array(
'func' => 'php_ini_check',
@ -130,20 +130,20 @@ expect ocasional failures',
'is_writable' => True,
'only_if_exists' => True
),
);
);
// some constanst for pre php4.3
if (!defined('PHP_SHLIB_SUFFIX'))
{
// some constanst for pre php4.3
if (!defined('PHP_SHLIB_SUFFIX'))
{
define('PHP_SHLIB_SUFFIX',strtoupper(substr(PHP_OS, 0,3)) == 'WIN' ? 'dll' : 'so');
}
if (!defined('PHP_SHLIB_PREFIX'))
{
}
if (!defined('PHP_SHLIB_PREFIX'))
{
define('PHP_SHLIB_PREFIX',PHP_SHLIB_SUFFIX == 'dll' ? 'php_' : '');
}
}
function extension_check($name,$args)
{
function extension_check($name,$args)
{
global $passed_icon, $error_icon, $warning_icon;
$is_win = strtoupper(substr(PHP_OS,0,3)) == 'WIN';
@ -165,28 +165,44 @@ function extension_check($name,$args)
echo $passed_icon."\n\n";
}
return $availible;
}
}
function verbosePerms( $in_Perms )
{
function verbosePerms( $in_Perms )
{
$sP;
if($in_Perms & 0x1000) // FIFO pipe
{
$sP = 'p';
}
elseif($in_Perms & 0x2000) // Character special
{
$sP = 'c';
}
elseif($in_Perms & 0x4000) // Directory
{
$sP = 'd';
}
elseif($in_Perms & 0x6000) // Block special
{
$sP = 'b';
}
elseif($in_Perms & 0x8000) // Regular
{
$sP = '-';
}
elseif($in_Perms & 0xA000) // Symbolic Link
{
$sP = 'l';
}
elseif($in_Perms & 0xC000) // Socket
{
$sP = 's';
}
else // UNKNOWN
{
$sP = 'u';
}
// owner
$sP .= (($in_Perms & 0x0100) ? 'r' : '-') .
@ -206,10 +222,10 @@ function verbosePerms( $in_Perms )
(($in_Perms & 0x0001) ? (($in_Perms & 0x0200) ? 't' : 'x' ) :
(($in_Perms & 0x0200) ? 'T' : '-'));
return $sP;
}
}
function permission_check($name,$args,$verbose=True)
{
function permission_check($name,$args,$verbose=True)
{
global $passed_icon, $error_icon, $warning_icon;
//echo "<p>permision_check('$name',".print_r($args,True).",'$verbose')</p>\n";
@ -296,10 +312,10 @@ function permission_check($name,$args,$verbose=True)
if ($handle) closedir($handle);
}
return $Ok;
}
}
function php_ini_check($name,$args)
{
function php_ini_check($name,$args)
{
global $passed_icon, $error_icon, $warning_icon;
$safe_mode = ini_get('safe_mode');
@ -351,10 +367,10 @@ function php_ini_check($name,$args)
echo "$passed_icon\n\n";
return True;
}
}
if ($run_by_webserver)
{
if ($run_by_webserver)
{
//echo "<html>\n<header>\n<title>Checking the eGroupWare install</title>\n</header>\n<body>\n";
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
@ -366,22 +382,22 @@ if ($run_by_webserver)
$GLOBALS['phpgw_setup']->html->show_header(lang('Checking the eGroupWare Installation'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')');
echo '<h1>'.lang('Checking the eGroupWare Installation')."</h1>\n";
echo "<pre style=\"text-align: left;\">\n";;
}
else
{
}
else
{
echo "Checking the eGroupWare Installation\n";
echo "====================================\n\n";
}
}
$Ok = True;
foreach ($checks as $name => $args)
{
$Ok = True;
foreach ($checks as $name => $args)
{
$check_ok = $args['func']($name,$args);
$Ok = $Ok && $check_ok;
}
}
if ($run_by_webserver)
{
if ($run_by_webserver)
{
echo "</pre>\n";;
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != 10)
@ -401,4 +417,5 @@ if ($run_by_webserver)
}
$setup_tpl->pparse('out','T_footer');
//echo "</body>\n</html>\n";
}
}
?>