定制 arus/monolog-telegram-handler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

arus/monolog-telegram-handler

最新稳定版本:v2.1.0

Composer 安装命令:

composer require arus/monolog-telegram-handler

包简介

Arus // Monolog Telegram Handler for PHP 7.2+ (incl. PHP 8)

README 文档

README

Build Status Code Coverage Scrutinizer Code Quality Total Downloads Latest Stable Version License

Installation (via composer)

composer require 'arus/monolog-telegram-handler:^2.1'

How to use?

use Arus\Monolog\Handler\TelegramHandler;
use Monolog\Logger;

$token = '000000000:000000000ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$recipient = '000000000';

$sender = new TelegramHandler($token, $recipient);

$logger = new Logger('app');
$logger->pushHandler($sender);

$logger->debug('Hello, world!');

Send a photo

$logger->debug('Hello, world!', [
    'photo' => 'https://example.com/photo.jpeg',
]);

Send an animation

$logger->debug('Hello, world!', [
    'animation' => 'https://example.com/animation.gif',
]);

Send a video

$logger->debug('Hello, world!', [
    'video' => 'https://example.com/video.mp4',
]);

Set custom API URL (relevant for Russia)

Via API

$sender->setUrl('https://proxy.api.telegram.example.com');

Via environment

putenv('TELEGRAM_URL=https://proxy.api.telegram.example.com');

Test run

Create your phpunit.xml file:

cp phpunit.xml.dist phpunit.xml

Open your phpunit.xml file and set the following environment variables: TELEGRAM_TOKEN and TELEGRAM_RECIPIENT, then:

php vendor/bin/phpunit --colors=always --coverage-text

Useful links

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固