PHP code example of rothkj1022 / php-error-handler
1. Go to this page and download the library: Download rothkj1022/php-error-handler 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/ */
rothkj1022 / php-error-handler example snippets
use rothkj1022\PHPErrorHandler;
$errorHandler = new PHPErrorHandler\PHPErrorHandler();
use rothkj1022\PHPErrorHandler;
$errorHandler = new PHPErrorHandler\PHPErrorHandler();
$errorHandler = new PHPErrorHandler\PHPErrorHandler([
'displayErrors' => false,
'emailErrors' => true,
'logErrors' => true, //ching lookups, such as ip addresses. Must end with slash.
'floodControl' => '15 MINUTE', //use mysql date_add interval syntax or set to false
'database' => [
/*'driver' => 'mysql', //pdo or mysql
'hostname' => DB_HOSTNAME,
'username' => DB_USERNAME,
'password' => DB_PASSWORD,
'database' => DB_DATABASE,
'port' => DB_PORT,
'charset' => DB_CHARSET,*/
'driver' => 'pdo', //pdo or mysql
'dsn' => 'mysql:host='.DB_HOSTNAME.';dbname='.DB_DATABASE.';port='.DB_PORT.';charset=UTF8',
'username' => DB_USERNAME,
'password' => DB_PASSWORD
],
'email' => [
'recipients' => [
'to' => [
[
'address' => '[email protected]',
'name' => 'Test Guy'
]
],
'from' => [
'address' => '[email protected]',
'name' => 'No Reply'
]
]
]);