Ejemplo n.º 1
0
/**
* --------------------------------------------------------------------------
* This function start the debug class
* --------------------------------------------------------------------------
* @param $status : Boolen : If 'true' start the debug class
* @return Void
*/
function custom_errors($status = false)
{
    if ($status) {
        require_once dirname(__DIR__) . '/vendor/php_error/php_error.php';
        \php_error\reportErrors();
    }
    return false;
}
Ejemplo n.º 2
0
<?php

namespace Skybet;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . "/ErrorReporting/php_error.php";
\php_error\reportErrors();
error_reporting(E_ALL);
$environment = 'development';
//loading routes
$router = new \League\Route\RouteCollection();
$router->addRoute('GET', '/', 'Skybet\\Controllers\\MainController::ListAll');
// Classname::methodName
$router->addRoute('POST', '/add', 'Skybet\\Controllers\\MainController::add');
$router->addRoute('POST', '/update', 'Skybet\\Controllers\\MainController::update');
$router->addRoute('POST', '/delete', 'Skybet\\Controllers\\MainController::del');
$dispatcher = $router->getDispatcher();
$response = $dispatcher->dispatch($_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI']);
$response->send();
Ejemplo n.º 3
0
 /**
  * Metodo Privado
  * ModoErroresZyos($ModReWrite = false)
  * 
  * @access private
  * Genera el proceso de activar los errores nativos de PHP y desactivarlos
  */
 private function ModoErroresZyos($ModReWrite = false)
 {
     $App = isset($ModReWrite[0]) == true ? $ModReWrite[0] : self::PREDETERMINADO;
     if (array_key_exists($App, $this->MatrizAccesos) == true) {
         if ($this->MatrizAccesos[$App]['Entorno_Desarrollo']['Localhost']['Activo'] == true) {
             if (array_key_exists($_SERVER['REMOTE_ADDR'], array_flip($this->MatrizAccesos[$App]['Entorno_Desarrollo']['Localhost']['ip'])) == true) {
                 error_reporting(E_ALL ^ E_STRICT);
                 if ($this->MatrizAccesos[$App]['Entorno_Desarrollo']['Localhost']['Plantilla'] == true) {
                     if (file_exists(implode(DIRECTORY_SEPARATOR, array(__SysNeuralFileRootLibNeural__, 'Librerias', 'Error', 'php_error.php'))) == true) {
                         require implode(DIRECTORY_SEPARATOR, array(__SysNeuralFileRootLibNeural__, 'Librerias', 'Error', 'php_error.php'));
                         \php_error\reportErrors();
                     }
                 }
             }
         } elseif ($this->MatrizAccesos[$App]['Entorno_Desarrollo']['Externo']['Activo'] == true) {
             error_reporting(E_ALL ^ E_STRICT);
             if ($this->MatrizAccesos[$App]['Entorno_Desarrollo']['Localhost']['Plantilla'] == true) {
                 if (file_exists(implode(DIRECTORY_SEPARATOR, array(__SysNeuralFileRootLibNeural__, 'Librerias', 'Error', 'php_error.php'))) == true) {
                     require implode(DIRECTORY_SEPARATOR, array(__SysNeuralFileRootLibNeural__, 'Librerias', 'Error', 'php_error.php'));
                     \php_error\reportErrors();
                 }
             }
         } else {
             error_reporting(0);
         }
     } else {
         error_reporting(0);
     }
 }
Ejemplo n.º 4
0
 /**
  * SysNeuralNucleo::CargarConfiguracionesModulo($Array = false);
  * 
  * Metodo para cargar los archivos que se encuentran dentro de la carpeta Aplicacion
  * @param $Array = false: Array con los parametros de la configuracion 
  * 
  **/
 public static function CargarConfiguracionesModulo($Array = false)
 {
     //Validamos que se ingrese el parametro
     if ($Array) {
         //Cargamos las opciones del Entorno
         if ($Array['Entorno_Desarrollo']) {
             //Validamos que exista el archivo de errores
             if (file_exists(dirname(__DIR__) . '/Errores/php_error.php')) {
                 error_reporting(E_ALL ^ E_STRICT);
                 require dirname(__DIR__) . '/Errores/php_error.php';
                 \php_error\reportErrors();
             } else {
                 //Si no Existe el Archivo generamos los Errores de PHP
                 error_reporting(E_ALL ^ E_STRICT);
             }
         } else {
             //No generamos mas errores
             error_reporting(0);
         }
         //Validamos si hay algun dato para enviar en el header correspondiente
         if (!empty($Array['Codificacion'])) {
             //Generamos la codificacion correspondiente
             header($Array['Codificacion']);
         }
     }
 }
Ejemplo n.º 5
0
if (!is_readable($file) || !cmsDEBUG) {
    function dump()
    {
    }
    function getExecInfo()
    {
    }
    function memoryUsage()
    {
    }
} else {
    require_once $file;
}
if (cmsDEBUG && false) {
    require_once cmsROOT . 'core/php_error.php';
    \php_error\reportErrors(array('snippet_num_lines' => 20, 'error_reporting_off' => 0, 'error_reporting_on' => E_ALL | E_STRICT, 'background_text' => 'Cybershade CMS'));
}
//Lets set a simple error template up till we have the template engine going
$errorTPL = '<h3>%s</h3> <p>%s Killing Process...</p>';
@set_magic_quotes_runtime(false);
//Check whether config files are present
$file = cmsROOT . 'assets/config.php';
if (!is_file($file) || file_get_contents($file) == '') {
    die(sprintf($errorTPL, 'Fatal Error', 'This seems to be your first time running. Are you looking for <a href="install/">Install/</a> ?'));
}
//make sure the file is readable, if so require it
if (!is_readable($file)) {
    die(sprintf($errorTPL, 'Fatal Error - 404', 'We have been unable to read the configuration file, please ensure correct privileges are given.'));
} else {
    require_once $file;
}
Ejemplo n.º 6
0
<?php

require dirname(__FILE__) . '/../src/php_error.php';
\php_error\reportErrors(array('display_line_numbers' => true));
function a()
{
    b();
}
function b()
{
    $foo = $bar;
}
a("fooobar fooobar fooobar fooobar fooobar fooobar fooobar fooobar fooobar fooobar", "fooobar", "fooobar", "fooobar", "fooobar", "fooobar", "fooobar", "fooobar");
Ejemplo n.º 7
0
| Prototype:
|
|	$autoload['language'] = array('lang1', 'lang2');
|
| NOTE: Do not include the "_lang" part of your file.  For example
| "codeigniter_lang.php" would be referenced as array('codeigniter');
|
*/
$autoload['language'] = array('application');
/*
| -------------------------------------------------------------------
|  Auto-load Models
| -------------------------------------------------------------------
| Prototype:
|
|	$autoload['model'] = array('first_model', 'second_model');
|
| You can also supply an alternative model name to be assigned
| in the controller:
|
|	$autoload['model'] = array('first_model' => 'first');
*/
$autoload['model'] = array();
/**
 * Load PHPError
 * todo Look into enabling save file feature because that would be bad ass
 */
if (ENVIRONMENT == 'development' && !is_cli() && config_item('use_php_error')) {
    require __DIR__ . '/../php_error.php';
    \php_error\reportErrors(array('application_folders' => 'application', 'ignore_folders' => 'system', 'enable_saving' => false));
}
Ejemplo n.º 8
0
<?php

require 'vendor/autoload.php';
use Symfony\Component\HttpFoundation\Request;
define('BASEDIR', __DIR__ . '/');
define('APPDIR', BASEDIR . 'app/');
define('SYSDIR', BASEDIR . 'system/');
define('VENDORDIR', BASEDIR . 'vendor/');
define('VIEWSDIR', APPDIR . 'views/');
// define set of local environments
$environments = array('local' => array('localhost'));
// Enable powerful debugger for local only.
if (in_array($_SERVER['HTTP_HOST'], $environments['local'])) {
    require SYSDIR . 'php_error.php';
    $options = array('enable_saving' => false, 'snippet_num_lines' => 10);
    \php_error\reportErrors($options);
}
// start running the application
require SYSDIR . 'app.php';
$app = new App(Request::createFromGlobals());
$app->start();
$app->router->run();
$app->shutdown();
Ejemplo n.º 9
0
function ErrorDebug()
{
    if (DEBUG) {
        ini_set('display_errors', 1);
        //set the options in an array
        $options = array('snippet_num_lines' => 10, 'background_text' => 'PPL Error', 'display_line_numbers' => true, 'snippet_num_lines' => 10, 'error_reporting_on' => E_ERROR | E_WARNING | E_PARSE);
        //require the script and run the function passing the options ar argument
        require Core . '/php_error.php';
        \php_error\reportErrors($options);
    }
}
Ejemplo n.º 10
0
} else {
    // PRODUCTION / RELEASE MODE
    define('SHOW_ERRORS', false);
    define('PHP_ERROR', false);
    define('de', false);
    define('log', false);
}
if (SHOW_ERRORS) {
    // View all error and notices
    error_reporting(E_ALL);
    ini_set("display_errors", 1);
}
if (PHP_ERROR) {
    require_once APP_PATH . 'other/php_error.php';
    $opt = array('catch_class_not_found' => false);
    \php_error\reportErrors($opt);
}
// Main logging and debug printer (to file)
if (de || log) {
    require_once APP_PATH . 'inc/logger.php';
}
// *******************************
function toggle_debug_mode()
{
    if (file_exists(DEBUG_ON)) {
        unlink(DEBUG_ON);
    } else {
        $f = fopen(DEBUG_ON, 'c');
        fclose($f);
    }
}
Ejemplo n.º 11
0
 *---------------------------------------------------------------
 * ERROR REPORTING
 *---------------------------------------------------------------
 *
 * Different environments will require different levels of error reporting.
 * By default development will show errors but testing and live will hide them.
 */
/*
 * Composer autoload
 */
require_once COMPOSERPATH . '/autoload.php';
/*
 * Load PHP_Error Library
 */
if ($config['enable_error_improvement']) {
    $e = \php_error\reportErrors(array('application_folders' => APPPATH, 'ignore_folders' => BASEPATH));
}
if (defined('ENVIRONMENT')) {
    switch (ENVIRONMENT) {
        case 'development':
            error_reporting(E_ALL);
            if ($config['enable_error_improvement']) {
                $e->turnOn();
            }
            break;
        case 'testing':
        case 'production':
            error_reporting(0);
            if ($config['enable_error_improvement']) {
                $e->turnOff();
            }