@@ -20,4 +20,6 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * As you get this only by an error in the code or during development, the message does not need to be translated |
| 22 | 22 | */ |
| 23 | -class AssertionFailed extends Api\Exception { } |
|
| 23 | +class AssertionFailed extends Api\Exception |
|
| 24 | +{ |
|
| 25 | +} |
|
@@ -29,7 +29,10 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | function __construct($msg=null,$code=100) |
| 31 | 31 | { |
| 32 | - if (is_null($msg)) $msg = lang('Permisson denied!'); |
|
| 32 | + if (is_null($msg)) |
|
| 33 | + { |
|
| 34 | + $msg = lang('Permisson denied!'); |
|
| 35 | + } |
|
| 33 | 36 | |
| 34 | 37 | parent::__construct($msg,$code); |
| 35 | 38 | } |
@@ -36,7 +36,11 @@ discard block |
||
| 36 | 36 | die("EGroupware requires PHP $egw_min_php_version or greater.<br />Please contact your System Administrator to upgrade PHP!"); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | -if (!defined('EGW_API_INC')) define('EGW_API_INC',PHPGW_API_INC); // this is to support the header upgrade |
|
| 39 | +if (!defined('EGW_API_INC')) |
|
| 40 | +{ |
|
| 41 | + define('EGW_API_INC',PHPGW_API_INC); |
|
| 42 | +} |
|
| 43 | +// this is to support the header upgrade |
|
| 40 | 44 | |
| 41 | 45 | /* Make sure the header.inc.php is current. */ |
| 42 | 46 | if (!isset($GLOBALS['egw_domain']) || $GLOBALS['egw_info']['server']['versions']['header'] < $GLOBALS['egw_info']['server']['versions']['current_header']) |
@@ -70,21 +74,32 @@ discard block |
||
| 70 | 74 | $GLOBALS['egw_info'] = array_merge($_SESSION[Session::EGW_INFO_CACHE],array('flags' => $GLOBALS['egw_info']['flags'])); |
| 71 | 75 | |
| 72 | 76 | // include required class-definitions |
| 73 | - if (is_array($_SESSION[Session::EGW_REQUIRED_FILES])) // all classes, which can not be autoloaded |
|
| 77 | + if (is_array($_SESSION[Session::EGW_REQUIRED_FILES])) |
|
| 78 | + { |
|
| 79 | + // all classes, which can not be autoloaded |
|
| 74 | 80 | { |
| 75 | 81 | foreach($_SESSION[Session::EGW_REQUIRED_FILES] as $file) |
| 76 | 82 | { |
| 77 | 83 | require_once($file); |
| 84 | + } |
|
| 78 | 85 | } |
| 79 | 86 | } |
| 80 | 87 | $GLOBALS['egw'] = unserialize($_SESSION[Session::EGW_OBJECT_CACHE]); |
| 81 | 88 | |
| 82 | - if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw)) // only egw object has wakeup2, setups egw_minimal eg. has not! |
|
| 89 | + if (is_object($GLOBALS['egw']) && ($GLOBALS['egw'] instanceof Egw)) |
|
| 83 | 90 | { |
| 84 | - $GLOBALS['egw']->wakeup2(); // adapt the restored egw-object/enviroment to this request (eg. changed current app) |
|
| 91 | + // only egw object has wakeup2, setups egw_minimal eg. has not! |
|
| 92 | + { |
|
| 93 | + $GLOBALS['egw']->wakeup2(); |
|
| 94 | + } |
|
| 95 | + // adapt the restored egw-object/enviroment to this request (eg. changed current app) |
|
| 85 | 96 | |
| 86 | 97 | $GLOBALS['egw_info']['flags']['session_restore_time'] = microtime(true) - $GLOBALS['egw_info']['flags']['page_start_time']; |
| 87 | - if (is_object($GLOBALS['egw']->translation)) return; // exit this file, as the rest of the file creates a new egw-object and -enviroment |
|
| 98 | + if (is_object($GLOBALS['egw']->translation)) |
|
| 99 | + { |
|
| 100 | + return; |
|
| 101 | + } |
|
| 102 | + // exit this file, as the rest of the file creates a new egw-object and -enviroment |
|
| 88 | 103 | } |
| 89 | 104 | // egw object could NOT be restored from the session, create a new one |
| 90 | 105 | unset($GLOBALS['egw']); |
@@ -18,4 +18,6 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Storing the row violates a unique key constrain |
| 20 | 20 | */ |
| 21 | -class NotUnique extends Db\Exception { } |
|
| 21 | +class NotUnique extends Db\Exception |
|
| 22 | +{ |
|
| 23 | +} |
|
@@ -19,4 +19,6 @@ |
||
| 19 | 19 | * New InvalidSql exception has to extend deprecated egw_exception_db_invalid_sql |
| 20 | 20 | * to allow legacy code to catch exceptions thrown by Api\Db! |
| 21 | 21 | */ |
| 22 | -class InvalidSql extends \egw_exception_db_invalid_sql {} |
|
| 22 | +class InvalidSql extends \egw_exception_db_invalid_sql |
|
| 23 | +{ |
|
| 24 | +} |
|
@@ -18,4 +18,6 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * EGroupware not (fully) installed, visit setup |
| 20 | 20 | */ |
| 21 | -class Setup extends Db\Exception { } |
|
| 21 | +class Setup extends Db\Exception |
|
| 22 | +{ |
|
| 23 | +} |
|
@@ -18,4 +18,6 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * PHP lacks support for configured database type |
| 20 | 20 | */ |
| 21 | -class Support extends Db\Exception { } |
|
| 21 | +class Support extends Db\Exception |
|
| 22 | +{ |
|
| 23 | +} |
|
@@ -18,4 +18,6 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Can not connect to database: eg. database down, wrong host, name or credentials |
| 20 | 20 | */ |
| 21 | -class Connection extends Db\Exception { } |
|
| 21 | +class Connection extends Db\Exception |
|
| 22 | +{ |
|
| 23 | +} |
|
@@ -29,7 +29,10 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | function __construct($msg=null,$code=100) |
| 31 | 31 | { |
| 32 | - if (is_null($msg)) $msg = lang('Database error!'); |
|
| 32 | + if (is_null($msg)) |
|
| 33 | + { |
|
| 34 | + $msg = lang('Database error!'); |
|
| 35 | + } |
|
| 33 | 36 | |
| 34 | 37 | parent::__construct($msg,$code); |
| 35 | 38 | } |