<?php /** * debug */ // sy_debug_level(SY_DEBUG_NONE); // sy_debug_level(SY_DEBUG_ERRORS); sy_debug_level(SY_DEBUG_ALL); /** * db */ $config['database'] = array('default' => array('*' => array('host' => 'localhost', 'username' => '', 'password' => '', 'name' => '', 'charset' => 'utf8'), 'production' => array('host' => 'localhost', 'username' => '', 'password' => '', 'name' => '', 'charset' => 'utf8', 'matchHost' => 'domain.com.br'))); /** * Disable Twig template cache. */ // $config['twig:disable_cache'] = true; require_once 'routes.php';
function sy_exception_handler($e) { if (sy_debug_level() && Simplify::request()->json()) { header('Content-type: application/json; charset="utf-8"'); $response = array('exception' => array('class' => get_class($e), 'message' => $e->getMessage(), 'trace' => $e->getTraceAsString(), 'file' => $e->getFile(), 'line' => $e->getLine())); $output = json_encode($response); } else { $output = ''; $output .= '<p>' . nl2br($e->getMessage()) . '</p><p>'; $output .= '<pre>' . htmlentities($e->getTraceAsString()) . '</pre>'; $output .= '</p>'; $output .= '<p>' . get_class($e) . ' thrown in ' . $e->getFile() . ' at line ' . $e->getLine() . '</p>'; $output .= ''; } ob_clean(); echo $output; exit; }