Exemplo n.º 1
0
 public function __construct(Bootstrap $bts, HandlerError $error)
 {
     parent::__construct();
     $debug = $error->isDebug();
     switch (getenv("entorno")) {
         case 'development':
             if ($debug == false) {
                 ini_set("display_errors", "Off");
             } else {
                 set_error_handler(array($error, 'inicializeError'));
             }
             break;
         case 'production':
             ini_set("display_errors", "Off");
             break;
     }
     $this->control($bts, $error);
 }
Exemplo n.º 2
0
<?php

use Disting\Handler\HandlerError;
use Disting\Environment;
use Disting\Doker;
use Disting\Bootstrap;
require 'start.php';
/*
	tipo de entorno que desea ejecutar
	development, production;
*/
try {
    if (version_compare(phpversion(), "5.4.4", "<")) {
        throw new \Exception("la version de php debe de ser mayor o igual a 5.4");
    }
    $handler = new HandlerError(new Environment('development', true));
    /*
        mostrar error si la clase y el metodo no se ah encontrado
        si se activa se controller uri no mostrara pagina de error
    */
    $handler->environment()->showErrorNotFoundClassAndMethod(false);
    /*
        mostrar error 404 si no se encuentra la clase
    */
    $handler->environment()->controllerUrl();
    /*
        control de modificacion de parametros por get
    */
    $handler->environment()->alertModifyParamsUrl();
    /*
        configuracion de  errores de la aplicacion