2 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4 // +----------------------------------------------------------------------+
5 // | Akelos Framework - http://www.akelos.org |
6 // +----------------------------------------------------------------------+
7 // | Copyright (c) 2002-2006, Akelos Media, S.L. & Bermi Ferrer Martinez |
8 // | Released under the GNU Lesser General Public License, see LICENSE.txt|
9 // +----------------------------------------------------------------------+
12 * This class will handle errors on production mode
13 * @todo Connect with Loggers in order to provide a strong error reporting
14 * system on production mode
16 * @package ActiveSupport
17 * @subpackage Reporting
18 * @author Bermi Ferrer <bermi a.t akelos c.om>
19 * @copyright Copyright (c) 2002-2006, Akelos Media, S.L. http://www.akelos.org
20 * @license GNU Lesser General Public License <http://www.gnu.org/copyleft/lesser.html>
22 class AkErrorHandler
{
28 function AkErrorHandler() {
34 * @param string $errMsg
40 function raiseError($errNo, $errMsg, $file, $line)
42 if (! ($errNo & error_reporting())) {
45 while (ob_get_level()) {
50 //echo nl2br(print_r(get_defined_vars(),true)).'<hr />';
51 if (! ($errNo & error_reporting())) {
54 while (ob_get_level()) {
65 64 => "Compile Error",
66 128 => "Compile Warning",
67 256 => "Php User Error",
68 512 => "Php User Warning",
69 1024 => "Php User Notice"
73 if(substr($errMsg,0,9) == 'database|'){
74 die('Database connection error');
75 header('Location: '.AK_URL
.Ak
::tourl(array('controller'=>'error','action'=>'database')));
81 if (($errNo & E_USER_ERROR
) && is_array($arr = @unserialize
($errMsg))) {
82 foreach ($arr as $k => $v) {