diff --git a/phpgwapi/inc/class.applications.inc.php b/phpgwapi/inc/class.applications.inc.php
index 03d081e085..d466e5ce9c 100755
--- a/phpgwapi/inc/class.applications.inc.php
+++ b/phpgwapi/inc/class.applications.inc.php
@@ -50,7 +50,7 @@
*/
function applications($account_id = '')
{
- if (is_object($GLOBALS['egw_setup']))
+ if (is_object($GLOBALS['egw_setup']) && is_object($GLOBALS['egw_setup']->db))
{
$this->db = clone($GLOBALS['egw_setup']->db);
}
diff --git a/phpgwapi/inc/class.egw.inc.php b/phpgwapi/inc/class.egw.inc.php
index f9a1ec104c..e8df0b3601 100644
--- a/phpgwapi/inc/class.egw.inc.php
+++ b/phpgwapi/inc/class.egw.inc.php
@@ -113,12 +113,12 @@
$this->db->select('phpgw_config','COUNT(config_name)',false,__LINE__,__FILE__);
if ($this->db->next_record())
{
- echo '
Fatal Error: You need to update eGroupWare before you can continue using it.';
+ throw new Exception('Fatal Error: You need to update eGroupWare before you can continue using it.',999);
}
else
{
- echo 'Fatal Error: It appears that you have not created the database tables for '
- .'eGroupWare. Click here to run setup.';
+ throw new Exception('Fatal Error: It appears that you have not created the database tables for '
+ .'eGroupWare. Click here to run setup.',999);
}
exit;
}
diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index d2ff7983e0..ed07adea67 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -50,11 +50,11 @@ if (!isset($GLOBALS['egw_info']['flags']['currentapp']))
echo '!!! PLEASE CORRECT THIS SITUATION !!!';
}
-include(EGW_API_INC.'/common_functions.inc.php');
+include_once(EGW_API_INC.'/common_functions.inc.php');
if (extension_loaded('memcache') && ini_get('session.save_handler') == 'memcache')
{
- include(EGW_API_INC.'/memcache.inc.php');
+ include_once(EGW_API_INC.'/memcache.inc.php');
}
// check if we can restore the eGW enviroment from the php-session
if ($GLOBALS['egw_info']['server']['sessions_type'] == 'php4-restore' && $_REQUEST['sessionid'])