Download the PHP package electrobayan/telegram-logger without Composer

On this page you can find all versions of the php package electrobayan/telegram-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package telegram-logger

Telegram Logger

Latest Version on Packagist

This extension allows you to see your project logs in real time using Telegram app.

How To Install

via Composer require command (composer 2 is required):

Just type into the CLI in your project root:

composer require electrobayan/telegram-logger

via updating composer.json:

{
    "require": {
        "electrobayan/telegram-logger": "^1.0"
    }
}

Then run in you CLI:

composer install

How To Use

Quick example:

You will have to create a Telegram bot and a channel. Check the user guide here. Then just do the following:

$infoLogger = new \TelegramLogger\Creator\InfoPoster('Telegram Key Goes here', '@your_telegram_channel_name');
$infoLogger->post('test', ['key_1' => 'value_1', 'key_2' => 'value_2'], ['tag1', 'tag2']);

Details

There 3 types of log messages:

You are free to create new if needed. Each of these types of messages has their own icons, frame and titles. Depending on what type you need you should use an appropriate Poster: InfoPoster, ErrorPoster or WarningPoster.

$errorLogger = new \TelegramLogger\Creator\ErrorPoster('Telegram Key Goes here', '@your_telegram_channel_name');
$warningLogger = new \TelegramLogger\Creator\WarningPoster('Telegram Key Goes here', '@your_telegram_channel_name');
$infoLogger = new \TelegramLogger\Creator\InfoPoster('Telegram Key Goes here', '@your_telegram_channel_name');

After the poster created all is left is just to call post method.

$errorLogger->post('Error Message', ['key_1' => 'value_1', 'key_2' => 'value_2'], ['tag1', 'tag2']);
$warningLogger->post('Warning Message', ['key_1' => 'value_1', 'key_2' => 'value_2'], ['tag1', 'tag2']);
$infoLogger->post('Info Message', ['key_1' => 'value_1', 'key_2' => 'value_2'], ['tag1', 'tag2']);

Also, you can pass optional extra params if needed as an array key => value. Both key and value will be posted into the channel. You can pass optional tags if needed as an array key => value. Only values will be posted into the channel.


All versions of telegram-logger with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
telegram-bot/api Version ^2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package electrobayan/telegram-logger contains the following files

Loading the files please wait ....