From 2c1197d9dca8b4e0a39cd6d65b3138f85c95d211 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 9 Mar 2004 21:05:28 +0000 Subject: [PATCH] fixes for installations with error_reporting E_ALL --- phpgwapi/inc/class.setup.inc.php | 2 +- phpgwapi/inc/functions.inc.php | 4 ++-- setup/applications.php | 2 +- setup/check_install.php | 23 +++++++++++++---------- setup/inc/functions.inc.php | 2 ++ 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/phpgwapi/inc/class.setup.inc.php b/phpgwapi/inc/class.setup.inc.php index 7d1a547570..9e10e35900 100644 --- a/phpgwapi/inc/class.setup.inc.php +++ b/phpgwapi/inc/class.setup.inc.php @@ -111,7 +111,7 @@ */ function set_cookie($cookiename,$cookievalue='',$cookietime=0) { - if(!$this->cookie_domain) + if(!isset($this->cookie_domain) || !$this->cookie_domain) { $this->set_cookiedomain(); } diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 9e8fc7ea13..f758600818 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -28,6 +28,8 @@ * If running in PHP3, then force admin to upgrade * \***************************************************************************/ + error_reporting(error_reporting() & ~E_NOTICE); + if (!function_exists('version_compare'))//version_compare() is only available in PHP4.1+ { echo 'eGroupWare requires PHP 4.1 or greater.
'; @@ -455,5 +457,3 @@ include(PHPGW_APP_INC . '/header.inc.php'); } } - - error_reporting(E_ERROR | E_WARNING | E_PARSE); diff --git a/setup/applications.php b/setup/applications.php index 0a8c11e8a7..df420ce003 100644 --- a/setup/applications.php +++ b/setup/applications.php @@ -11,7 +11,7 @@ /* $Id$ */ - $DEBUG = $_POST['debug'] || $_GET['debug']; + $DEBUG = @$_POST['debug'] || @$_GET['debug']; /* TODO: We allow a user to hose their setup here, need to make use of dependencies so they are warned that they are pulling the rug diff --git a/setup/check_install.php b/setup/check_install.php index 69808d9bec..11b0711369 100644 --- a/setup/check_install.php +++ b/setup/check_install.php @@ -22,7 +22,9 @@ 'currentapp' => 'home', 'noapi' => True ); + $safe_er = error_reporting(); include ('./inc/functions.inc.php'); + error_reporting($safe_er); $GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->detection->check_header(); if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == '10') @@ -55,6 +57,7 @@ If safe_mode is turned on, eGW is not able to change certain settings on runtime *** 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) !!!' ), +/* not longer needed, as it gets set now on runtime (works even with safe_mode) 'error_reporting' => array( 'func' => 'php_ini_check', 'value' => E_NOTICE, @@ -62,6 +65,7 @@ which leaves your DB in an unrecoverable state (your data is lost) !!!' 'check' => 'not set', 'safe_mode' => 'error_reporting = E_ALL & ~E_NOTICE' ), +*/ 'magic_quotes_runtime' => array( 'func' => 'php_ini_check', 'value' => 0, @@ -169,8 +173,6 @@ expect ocasional failures', function verbosePerms( $in_Perms ) { - $sP; - if($in_Perms & 0x1000) // FIFO pipe { $sP = 'p'; @@ -243,8 +245,7 @@ expect ocasional failures', if ($verbose) { - echo "Checking file-permissions of $rel_name for $checks: "; - + $perms = ''; if (file_exists($name)) { $owner = function_exists('posix_getpwuid') ? posix_getpwuid(@fileowner($name)) : array('name' => 'nn'); @@ -256,15 +257,16 @@ expect ocasional failures', if (isset($args['is_world_writable'])) $checks[] = (!$args['is_world_writable']?'not ':'').'world writable'; $checks = implode(', ',$checks); - echo "$owner[name]/$group[name] ".verbosePerms(@fileperms($name)); + $perms = "$owner[name]/$group[name] ".verbosePerms(@fileperms($name)); } - echo "\n"; + echo "Checking file-permissions of $rel_name for $checks: $perms\n"; } if (!file_exists($name)) { echo "$error_icon$rel_name does not exist !!!\n"; return False; } + $warning = False; if (!$GLOBALS['run_by_webserver'] && ($args['is_readable'] || $args['is_writable'])) { echo "$warning_icon check can only be performed, if called via a webserver, as the user-id/-name of the webserver is not known.\n"; @@ -299,7 +301,7 @@ expect ocasional failures', } if ($verbose) echo "\n"; - if ($Ok && $args['recursiv'] && is_dir($name)) + if ($Ok && @$args['recursiv'] && is_dir($name)) { $handle = @opendir($name); while($handle && ($file = readdir($handle))) @@ -323,6 +325,7 @@ expect ocasional failures', $ini_value = ini_get($name); $check = isset($args['check']) ? $args['check'] : '='; $verbose_value = isset($args['verbose_value']) ? $args['verbose_value'] : $args['value']; + $ini_value_verbose = ''; if ($verbose_value == 'On' || $verbose_value == 'Off') { $ini_value_verbose = ' = '.($ini_value ? 'On' : 'Off'); @@ -357,9 +360,9 @@ expect ocasional failures', { echo $error_icon.$args['error']."\n"; } - if (isset($args['safe_mode']) && $safe_mode || $args['change']) + if (isset($args['safe_mode']) && $safe_mode || @$args['change']) { - echo "Please make the following change in your php.ini: ".($args['safe_mode']?$args['safe_mode']:$args['change'])."\n"; + echo $error_icon."Please make the following change in your php.ini: ".($args['safe_mode']?$args['safe_mode']:$args['change'])."\n"; } echo "\n"; return False; @@ -379,7 +382,7 @@ expect ocasional failures', 'T_footer' => 'footer.tpl', )); $ConfigDomain = get_var('ConfigDomain',Array('POST','COOKIE')); - $GLOBALS['phpgw_setup']->html->show_header(lang('Checking the eGroupWare Installation'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')'); + $GLOBALS['phpgw_setup']->html->show_header(lang('Checking the eGroupWare Installation'),False,'config',$ConfigDomain . '(' . @$phpgw_domain[$ConfigDomain]['db_type'] . ')'); echo '

'.lang('Checking the eGroupWare Installation')."

\n"; echo "
\n";;
 	}
diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php
index 8f54b002ff..041f4640f0 100644
--- a/setup/inc/functions.inc.php
+++ b/setup/inc/functions.inc.php
@@ -28,6 +28,8 @@
 	unset($d1);unset($d2);unset($d3);
 	/* ######## End security check ########## */
 
+	error_reporting(error_reporting() & ~E_NOTICE);
+
 	if(file_exists('../header.inc.php'))
 	{
 		include('../header.inc.php');