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

捕获致命错误并在Slack中通知。

安装

您可以通过composer安装 php-fatal-err-catcher 或下载源代码。

通过Composer

php-fatal-err-catcher 作为 mhdaldossari7/php-fatal-err-catcher 包在Packagist上可用

composer require mhdaldossari7/php-fatal-err-catcher

使用方法

<?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.