Download the PHP package victor78/yii2-messenger-target without Composer

On this page you can find all versions of the php package victor78/yii2-messenger-target. 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 yii2-messenger-target

Yii2MessengerTarget

MessengerTarget for Yii2 for sending logs as text and/or as files (of which archives) through messengers. Now this extension supports as messenger only Telegram.

MessengerTarget для Yii2 для отправки логов как текст и/или как файлы(в том числе как архивы) через месенджеры. Сейчас расширение поддерживает в качестве месседжера только Телеграм.

English:

Русский:

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json.

Configuration

How to create telegram bot

  1. Message @botfather https://telegram.me/botfather with the following text: /newbot If you don't know how to message by username, click the search field on your Telegram app and type @botfather, where you should be able to initiate a conversation. Be careful not to send it to the wrong contact, because some users has similar usernames to botfather.

    botfather initial conversation

  2. @botfather replies with Alright, a new bot. How are we going to call it? Please choose a name for your bot.

  3. Type whatever name you want for your bot.

  4. @botfather replies with

  5. Type whatever username you want for your bot, minimum 5 characters, and must end with bot. For example: telesample_bot

  6. @botfather replies with:

  7. Note down the 'token' mentioned above.

  8. Type /setprivacy to @botfather.

    botfather later conversation

  9. @botfather replies with Choose a bot to change group messages settings.

  10. Type (or select) @telesample_bot (change to the username you set at step 5 above, but start it with @)
  11. @botfather replies with

  12. Type (or select) Disable to let your bot receive all messages sent to a group. This step is up to you actually.

  13. @botfather replies with Success! The new status is: DISABLED. /help

How to take telegram chat id which will receive messages from the bot

Send the /my_id to telegram bot @get_id_bot or use the instruction.

How to use

It is enough to configure component right, and it will work. To test yout configuration, add it, for example, to some controller:

Notes

For archiving MessengerTarget use yii2-zipper.

Установка

Предпочтительный способ установки расширения через composer.

Либо запуск из консоли

либо в composer.json в секции required

Настройка

Как создать телеграм бота

  1. Напишите боту @botfather https://telegram.me/botfather следующий текст (команду): /newbot Если вы не в курсе как отправить сообщение пользователю по его username, кликните по поиску вашего приложения Телеграм и наберите @botfather, где вы получите возможность начать переписку с данным пользователем (в данном случае - ботом). Будьте внимательны, поскольку некоторые пользователи используют схожий c botfather username.

    botfather initial conversation

  2. @botfather ответит Alright, a new bot. How are we going to call it? Please choose a name for your bot.

  3. Отправьте сообщение с именем бота в ответ.

  4. @botfather ответит

  5. Отправьте в ответе username для бота - оно должно быть длинее 5 символов, заканчиваться на bot. Например: telesample_bot

  6. @botfather ответит:

  7. Сохраните токен.

  8. Отправьте боту @botfather сообщение /setprivacy.

    botfather later conversation

  9. @botfather ответит Choose a bot to change group messages settings.

  10. Наберите (или выберите) вашего бота @telesample_bot (выберите по username вашего бота)
  11. @botfather ответит

  12. Наберите (или выберите) Disable чтобы позволить вашему боту работать у группах.

  13. @botfather ответит Success! The new status is: DISABLED. /help

Как получить id чата (id пользователя), который будет получать сообщения от бота

Отправьте /my_id телеграм боту @get_id_bot или используйте инструкцию.

Как использовать

Достаточно настроить компонент верно, и логирование через мессенджер будет работать. Протестировать верно ли настроено логирование можно добавив следующий код, например, в контроллер:

Замечания

Для архивации файлов MessengerTarget использует yii2-zipper.


All versions of yii2-messenger-target with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
yiisoft/yii2 Version *
victor78/yii2-zipper Version ~0.0.4
yiisoft/yii2-httpclient Version ~2.0.0
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 victor78/yii2-messenger-target contains the following files

Loading the files please wait ....