getTrace(); if ($retornar) ob_start(); echo '

Excepção lançada

'; echo '

Trace simples:


'; foreach ($debugInfo as $prof => $info) { echo "Profundidade: $prof
"; echo "Ficheiro: " . $info['file'] . "
"; echo "Linha: " . $info['line'] . "
"; echo "Função: " . $info['function'] . "

"; } echo '
Mensagem:
' . $exc->getMessage() . '

'; echo '

Trace completo:


';
        print_r($debugInfo);
        echo "
"; if ($retornar) return ob_get_clean(); } set_exception_handler('applExcHandlerPDefeitoDebug'); } else { function applExcHandlerPDefeitoProd($exc, $retornar = false) { // Produção: silencioso } set_exception_handler('applExcHandlerPDefeitoProd'); } // Constantes de URL e caminhos define("URL_SITE", $StrMainSite); define("URL_ADMIN", $StrAdminStie); define("DOC_ROOT_SITE", $_SERVER['DOCUMENT_ROOT'] . '/'); define("URL_IMG", URL_SITE . '/img/'); define("URL_FOTOS", URL_SITE . '/fotos/'); define("URL_FOTOS_AGENDA", URL_FOTOS . 'agenda/'); define("URL_FOTOS_TEXTOS", URL_FOTOS . 'textos/'); define("URL_FOTOS_LOJA", URL_FOTOS . 'produtos/'); define("URL_FOTOS_DESTAQUES", URL_FOTOS . 'destaques/'); define("URL_FOTOS_LINKS", URL_FOTOS . 'links/'); define("URL_FOTOS_NOTICIAS", URL_FOTOS . 'noticias/'); define("URL_FOTOS_CATALOGOS", URL_FOTOS . 'catalogos/'); define("URL_FOTOS_PORTFOLIO", URL_FOTOS . 'portfolio/'); define("URL_FOTOS_GALERIA", URL_FOTOS . 'galeria/'); // Outras configurações define('VAL_VAR_SUBMISSAO_FORM', 417); define("MAX_CHARS_LISTA_BODY", 150); define("MAX_CHARS_LISTA_DIR", 50); define("MAX_CHARS_COMENTARIO_PRODUTO", 100); define("MAX_CHARS_DESTAQUE_PRODUTO", 100); define('MAX_REGS_P_PAGINA', 15); define('MAX_REGS_P_PAGINA_GEST', 20); define('MAX_REGS_PESQUISA_STR', 1); define('MAX_REGS_P_GALERIA', 15); // Emails define('END_EMAIL_ENCOMENDAS', 'geral@juventudecandelaria.com'); define('END_EMAIL_CONTACTOS', 'geral@juventudecandelaria.com'); define('END_EMAIL_ASSISTENCIA', 'geral@juventudecandelaria.com'); // Includes include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/mysql/beta/class.mysql.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/fotos/class.fotos.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/data/beta/class.data.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/paginacao/class.paginacao.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/userlogin/class.userlogin.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/class.query.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/class.email.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/api/class.text.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/scripts/smtp.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/hackerThrowOff.php"); define("SMARTY_DIR", $_SERVER['DOCUMENT_ROOT'] . "/inc/smarty/"); define("TEMPLATES_PATH", $_SERVER['DOCUMENT_ROOT'] . "/inc/templates"); define("TEMPLATES_C_PATH", $_SERVER['DOCUMENT_ROOT'] . "/inc/templates_c"); define("CONFIGS_PATH", $_SERVER['DOCUMENT_ROOT'] . "/inc/configs"); define("CACHE_PATH", $_SERVER['DOCUMENT_ROOT'] . "/inc/cache"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/smarty/Config_File.class.php"); include_once($_SERVER['DOCUMENT_ROOT'] . "/inc/smarty/Smarty.class.php"); // Criando a instância da classe MySQL $ObjMySQL = new MySQL($StrDBHost, $StrDBUsername, $StrDBPassword, $StrDBName); // A conexão com o banco de dados já é feita no construtor, então não precisa chamar ConnectToServer separadamente // $ObjMySQL->ConnectToServer($StrDBHost, $StrDBUsername, $StrDBPassword); // Esta linha é desnecessária agora // Selecionando o banco de dados (se necessário) $ObjMySQL->SelectMyDataBase($StrDBName); // já incluído automaticamente na classe $ObjSmarty = new Smarty(); $ObjText = new TextConvert; $ObjQuery = new Query; $ObjFotos = new Photo; $ObjData = new Date; $ObjEmail = new Email; /* $smtp = new smtp_class; $smtp->host_name = "localhost"; $smtp->host_port = 25; $smtp->ssl = 0; $smtp->localhost = "localhost"; $smtp->direct_delivery = 0; $smtp->timeout = 10; $smtp->data_timeout = 0; $smtp->debug = 1; $smtp->html_debug = 1; $smtp->pop3_auth_host = $SiteSMTPAddress; $smtp->user = $SiteSMTPEmail; $smtp->realm = ""; $smtp->password = $SiteSMTPEmailPassword; $smtp->workstation = ""; $smtp->authentication_mechanism = ""; */ // Função utilitária function configRetornarTextoBdTruncado($textoCompleto, $maxChars) { $textoCompleto = trim($textoCompleto); $textoCompleto = substr(strip_tags($textoCompleto), 0, $maxChars); $textoCompleto .= (strlen($textoCompleto) >= $maxChars) ? '(...)' : ''; return $textoCompleto; } ?>