diff --git a/system/system.php b/system/system.php index 7fc2e44..cc698b9 100644 --- a/system/system.php +++ b/system/system.php @@ -422,7 +422,7 @@ set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($engine){ } if ($engine->config->get('config_error_display')) { - echo '' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline . ''; + echo '
' . $error . ': ' . $errstr . ' in ' . str_replace(\Phacil\Framework\Config::DIR_APPLICATION(), "", $errfile) . ' on line ' . $errline . '
'; } if ($engine->config->get('config_error_log')) { @@ -434,11 +434,14 @@ set_error_handler(function ($errno, $errstr, $errfile, $errline) use ($engine){ set_exception_handler(function($e) use ($engine) { if ($engine->config->get('config_error_display')) { - echo '' . get_class($e) . ': ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . ''; + echo '' . get_class($e) . ': ' . $e->getMessage() . ' in ' .str_replace(\Phacil\Framework\Config::DIR_APPLICATION(), '', $e->getFile()) . ' on line ' . $e->getLine() . '
'; } - $exception = new \Phacil\Framework\Exception(); - $exception->setObject($e); + if(get_class($e) != 'Phacil\Framework\Exception'){ + $exception = new \Phacil\Framework\Exception(); + $exception->setObject($e); + } + if ($engine->config->get('config_error_log')) { $engine->log->write(get_class($e) . ': ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine()); diff --git a/system/templateEngines/Twig/Extension/ExacTITranslate.php b/system/templateEngines/Twig/Extension/ExacTITranslate.php index 3865d13..2bec143 100644 --- a/system/templateEngines/Twig/Extension/ExacTITranslate.php +++ b/system/templateEngines/Twig/Extension/ExacTITranslate.php @@ -179,7 +179,7 @@ function traduzir() { $body = array_shift($params); if (class_exists('Translate')) { - $trans = new Phacil\Framework\Translate(); + $trans = new \Phacil\Framework\Translate(); echo ($trans->translation($body)); } else { echo $body; diff --git a/system/templateEngines/Twig/Extension/ExacTITranslate1x.php b/system/templateEngines/Twig/Extension/ExacTITranslate1x.php index 441ae3f..cb54b73 100644 --- a/system/templateEngines/Twig/Extension/ExacTITranslate1x.php +++ b/system/templateEngines/Twig/Extension/ExacTITranslate1x.php @@ -179,7 +179,7 @@ function traduzir() { $body = array_shift($params); if (class_exists('Translate')) { - $trans = new Phacil\Framework\Translate(); + $trans = new \Phacil\Framework\Translate(); echo ($trans->translation($body)); } else { echo $body;