Lançado Adianti Framework 7.6!
Clique aqui para saber mais
menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Source for file TExceptionView.php

Documentation is available at TExceptionView.php

  1. <?php
  2. namespace Adianti\Widget\Util;
  3.  
  4. use Adianti\Widget\Container\TTable;
  5. use Adianti\Widget\Container\TScroll;
  6. use Adianti\Widget\Dialog\TMessage;
  7. use Adianti\Core\AdiantiCoreTranslator;
  8.  
  9. use Exception;
  10. use Throwable;
  11.  
  12. /**
  13.  * Exception visualizer
  14.  *
  15.  * @version    7.4
  16.  * @package    widget
  17.  * @subpackage util
  18.  * @author     Pablo Dall'Oglio
  19.  * @copyright  Copyright (c) 2006 Adianti Solutions Ltd. (http://www.adianti.com.br)
  20.  * @license    http://www.adianti.com.br/framework-license
  21.  */
  22. {
  23.     /**
  24.      * Constructor method
  25.      */
  26.     function __construct(Throwable $e)
  27.     {
  28.         $error_array $e->getTrace();
  29.         $table new TTable;
  30.         $row=$table->addRow();
  31.         $row->addCell('<b>' $e->getMessage('</b><br>' $e->getFile(':' $e->getLine('<br>');
  32.         $row=$table->addRow();
  33.         $row->addCell('&nbsp;');
  34.         
  35.         foreach ($error_array as $error)
  36.         {
  37.             $file = isset($error['file']$error['file''';
  38.             $line = isset($error['line']$error['line''';
  39.             $file str_replace(PATH''$file);
  40.             
  41.             $row=$table->addRow();
  42.             $row->addCell('File: '.$file':'$line);
  43.             $row=$table->addRow();
  44.             $args array();
  45.             if (!empty($error['args']))
  46.             {
  47.                 foreach ($error['args'as $arg)
  48.                 {
  49.                     if (is_object($arg))
  50.                     {
  51.                         $args[get_class($arg)' object';
  52.                     }
  53.                     else if (is_array($arg))
  54.                     {
  55.                         $array_param array();
  56.                         foreach ($arg as $value)
  57.                         {
  58.                             if (is_object($value))
  59.                             {
  60.                                 $array_param[get_class($value);
  61.                             }
  62.                             else if (is_array($value))
  63.                             {
  64.                                 $array_param['array';
  65.                             }
  66.                             else
  67.                             {
  68.                                 $array_param[$value;
  69.                             }
  70.                         }
  71.                         $args[implode(','$array_param);
  72.                     }
  73.                     else
  74.                     {
  75.                         $args[= (string) $arg;
  76.                     }
  77.                 }
  78.             }
  79.             $class = isset($error['class']$error['class''';
  80.             $type  = isset($error['type'])  $error['type']  '';
  81.             
  82.             $row->addCell('&nbsp;&nbsp;<i>'.'<font color=green>'.$class.'</font>'.
  83.                                             '<font color=olive>'.$type.'</font>'.
  84.                                             '<font color=darkblue>'.$error['function'].'</font>'.
  85.                                             '('.'<font color=maroon>'.implode(','$args).'</font>'.')</i>');
  86.         }
  87.         
  88.         ob_start();
  89.         $table->show();
  90.         $content ob_get_clean();
  91.         
  92.         new TMessage('error'$contentNULLAdiantiCoreTranslator::translate('Exception'));
  93.     }
  94. }