Skip to content

telebugs/telebugs-php

Repository files navigation

Telebugs for PHP

Package Version

Refreshingly simple error monitoring. Catch production errors automatically and instantly report them to Telegram.

Introduction

Any PHP application or script can be integrated with Telebugs using the telebugs/telebugs package. The package is designed to be simple and easy to use. It provides a simple API to send errors to Telebugs, which will then be reported to your Telegram project. This guide will help you get started with Telebugs for PHP.

For full details, please refer to the Telebugs documentation.

Installation

Install the package using Composer by executing:

composer require telebugs/telebugs

Usage

This is the minimal example that you can use to test Telebugs for PHP with your project:

<?php
require 'vendor/autoload.php';

// Configure Telebugs as early as possible in your application.
Telebugs\configure(function ($config) {
    $config->setApiKey("YOUR_API_KEY");
});

try {
    1 / 0;
} catch (DivisionByZeroError $e) {
    Telebugs\report($e)->wait();
}

echo "An error was sent to Telebugs." .
    "It will appear in your dashboard shortly." .
    "A notification was also sent to your Telegram chat."
?>

Replace YOUR_API_KEY with your actual API key. You can ask @TelebugsBot for your API key or find it in your project's dashboard.

Telebugs for PHP integrations

Telebugs for PHP is a standalone package that can be used with any PHP application or script. It can be integrated with any PHP framework or library.

We provide official integrations for the following PHP platforms:

PHP support policy

Telebugs for PHP supports the following PHP versions:

  • PHP 8.1+

If you need support older PHP versions, please contact us at [email protected].

Development

After checking out the repo, run composer install to install dependencies. Then, run composer test to run the tests.

To check the code with PHPStan, run composer phpstan.

To release a new version, simply push a new tag to the repository. Packagist will automatically update the package.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/telebugs/telebugs-php.