@@ -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 | } |
@@ -121,10 +121,13 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | throw new Exception('next_record called with no query pending.'); |
| 123 | 123 | } |
| 124 | - if ($this->Row) // first row is already fetched |
|
| 124 | + if ($this->Row) |
|
| 125 | + { |
|
| 126 | + // first row is already fetched |
|
| 125 | 127 | { |
| 126 | 128 | $this->Query_ID->MoveNext(); |
| 127 | 129 | } |
| 130 | + } |
|
| 128 | 131 | ++$this->Row; |
| 129 | 132 | |
| 130 | 133 | $this->Record = $this->Query_ID->fields; |
@@ -133,12 +136,15 @@ discard block |
||
| 133 | 136 | { |
| 134 | 137 | return False; |
| 135 | 138 | } |
| 136 | - if ($this->capabilities[self::CAPABILITY_NAME_CASE] == 'upper') // maxdb, oracle, ... |
|
| 139 | + if ($this->capabilities[self::CAPABILITY_NAME_CASE] == 'upper') |
|
| 140 | + { |
|
| 141 | + // maxdb, oracle, ... |
|
| 137 | 142 | { |
| 138 | 143 | switch($fetch_mode) |
| 139 | 144 | { |
| 140 | 145 | case self::FETCH_ASSOC: |
| 141 | 146 | $this->Record = array_change_key_case($this->Record); |
| 147 | + } |
|
| 142 | 148 | break; |
| 143 | 149 | case self::FETCH_NUM: |
| 144 | 150 | $this->Record = array_values($this->Record); |
@@ -199,7 +205,8 @@ discard block |
||
| 199 | 205 | * @return bool True if sucessful, False if fails |
| 200 | 206 | */ |
| 201 | 207 | function unlock() |
| 202 | - {} |
|
| 208 | + { |
|
| 209 | +} |
|
| 203 | 210 | |
| 204 | 211 | /** |
| 205 | 212 | * Number of rows in current result set |
@@ -289,7 +296,10 @@ discard block |
||
| 289 | 296 | { |
| 290 | 297 | if (!is_numeric($column)) |
| 291 | 298 | { |
| 292 | - if ($strip) $column = str_replace($strip,'',$column); |
|
| 299 | + if ($strip) |
|
| 300 | + { |
|
| 301 | + $column = str_replace($strip,'',$column); |
|
| 302 | + } |
|
| 293 | 303 | |
| 294 | 304 | $result[$column] = $value; |
| 295 | 305 | } |
@@ -301,4 +311,6 @@ discard block |
||
| 301 | 311 | /** |
| 302 | 312 | * @deprecated use EGroupware\Api\Db\CallbackIterator |
| 303 | 313 | */ |
| 304 | -class egw_db_callback_iterator extends Api\Db\CallbackIterator {} |
|
| 314 | +class egw_db_callback_iterator extends Api\Db\CallbackIterator |
|
| 315 | +{ |
|
| 316 | +} |
|