mhdaldossari7/php-fatal-err-catcher

v2.1.0 2021-01-28 12:53 UTC

This package is auto-updated.

Last update: 2024-09-28 21:10:59 UTC


README

To catch fatal errors and notify in slack.

Installation

You can install php-fatal-err-catcher via composer or by downloading the source.

Via Composer:

php-fatal-err-catcher is available on Packagist as the mhdaldossari7/php-fatal-err-catcher package:

composer require mhdaldossari7/php-fatal-err-catcher

Usage

<?php

declare (strict_types = 1);

require __DIR__ . '/vendor/autoload.php';

use FatalErrCatcher\ErrorCatcher; // import class

$slackWebhookURL = "https://xxxxx"; // define slack url if you want to get notification in slack

new ErrorCatcher($slackWebhookURL); // initialize object ($slackWebhookURL is optional argument, if you didn't provide slack_url the error message will be print in console)


// (IMPORTANT NOTE) : You must create ErrorCatcher object at the beginning of your script, so it detects the incoming errors.