Download the PHP package expertskb/telegram_php without Composer
On this page you can find all versions of the php package expertskb/telegram_php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download expertskb/telegram_php
More information about expertskb/telegram_php
Files in expertskb/telegram_php
Package telegram_php
Short Description The 'TelegramPhp' class facilitates database backup operations by exporting tables and data into a SQL file.
License GPL-2.0-or-later
Informations about the package telegram_php
Here's an updated version of the README.md guide with additional information about the setDebug()
method:
TelegramPhp Database Backup Library
The TelegramPhp
class facilitates database backup operations by exporting tables and data into a SQL file and sending it to a Telegram chat. This library is useful for automating database backups and sending them to specified Telegram chats for storage and monitoring.
Installation
You can install this library via Composer. Run the following command in your terminal:
Usage
Step 1: Initialize the Backup Class
First, you need to initialize the Backup
class by providing the necessary parameters:
$host
: The hostname of the database server.$username
: The username used to connect to the database.$database
: The name of the database to be backed up.$password
: The password used to connect to the database.$bot_token
: The Telegram bot token used to send the backup file.$chat_id
: The ID of the Telegram chat or an array of chat IDs where you want to send the backup.
Step 2: Run the Backup Process
To start the backup process, simply call the run()
method of the Backup
class:
This will export the database tables and data into a SQL file and send it to the specified Telegram chat(s).
Optional: Enable Debug Mode
You can enable debug mode to receive detailed logs by calling the setDebug()
method:
Example
Requirements
- PHP 5.6 or higher
- MySQLi extension enabled
- cURL extension enabled
License
This library is open-source and released under the MIT License. See the LICENSE file for details.
Feel free to customize this README according to your preferences and add any additional information or usage examples as needed.