承接 zafarjonovich/yii-telegram-error-handler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zafarjonovich/yii-telegram-error-handler

Composer 安装命令:

composer require zafarjonovich/yii-telegram-error-handler

包简介

YiiTelegramErrorHandler

README 文档

README

Installation

Assalomu aleykum. This component is for yii2 framework. You can use this component to send your exceptions to your telegram. It is very easy to use.

If you are creating a web application, you need to put the following code in config/web.php

<?php

$config = [
 ...
 'components' => [
 ...
	 'errorHandler' => [
		'class' => 'zafarjonovich\YiiTelegramErrorHandler\Web' ,
		'telegram' => [
			'bot_token' => '123456789:ABCKDFHJKSDHKSJHDFKDHF' ,
			'chat_ids' => [123,234,456]
		]
	]

];

?>


If you are creating a console application, you need to put the following code in config / web.php
<?php
$config = [
    ...
    'components' => [
        ...
        'errorHandler' => [
            'class' => 'zafarjonovich\YiiTelegramErrorHandler\Console' ,
            'telegram' => [
                'bot_token' => '123456789:ABCKDFHJKSDHKSJHDFKDHF' ,
                'chat_ids' => [123,234,456]
            ]
        ]

    ];
?>


Set telegram message structure

You can change the structure of messages that go to the telegram. It is very easy to use.There are 4 placements here.

  • {message} - exception message
  • {file} - exception file
  • {line} - exception line
  • {code} - exception code

You set up your message structure as follows

<?php

$config = [
 ...
 'components' => [
 ...
	 'errorHandler' => [
		'class' => 'zafarjonovich\YiiTelegramErrorHandler\Console' ,
		'telegram' => [
			...
			'message_structure' => "File: {file}\n\nLine: {line}"
		]
	]

];
?>

Typically, the following message structure consists of:

Message:>Message:>Message: {message}\n\nFile: {file}\n\nLine: {line}\n\nCode: {code}

统计信息

  • 总下载量: 8.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固