PHP code example of flextype-components / errorhandler

1. Go to this page and download the library: Download flextype-components/errorhandler library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flextype-components / errorhandler example snippets


use Flextype\Component\ErrorHandler\ErrorHandler;

$show_errors = true;

if ($show_errors) {
    define('DEVELOPMENT', true);
    error_reporting(-1);
} else {
    define('DEVELOPMENT', false);
    error_reporting(0);
}

define('LOGS_PATH', 'path/to/logs');

set_error_handler('Flextype\Component\ErrorHandler\ErrorHandler::error');
register_shutdown_function('Flextype\Component\ErrorHandler\ErrorHandler::fatal');
set_exception_handler('Flextype\Component\ErrorHandler\ErrorHandler::exception');