From 2cdf37c8e2504b9509386fff23b7e722a259377b Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Sun, 9 Jun 2019 20:47:46 +0300 Subject: [PATCH] Update readme & composer & name Update response generation --- README.md | 8 ++++---- bootstrap.php | 11 +++++------ composer.json | 4 ++-- composer.lock | 2 +- server.php | 4 ++-- src/Client.php | 2 +- src/Config.php | 2 +- src/RequestCallback.php | 4 ++-- src/Server.php | 2 +- 9 files changed, 19 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d0def67..965d17d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# TelegramSwooleClient +# TelegramApiServer Fast, simple, async php telegram client and parser: [MadelineProto](https://github.com/danog/MadelineProto) and [Swoole](https://github.com/swoole/swoole-src) Server @@ -9,19 +9,19 @@ Fast, simple, async php telegram client and parser: **Features** * Fast async swoole server -* Use as micro-service to access telegram api -* Get any telegram posts as json +* Full access to telegram api: bot and user **Example Architecture** ![Proposed Architecture](https://habrastorage.org/webt/qz/ax/ct/qzaxctkgwehhhsqglgszy4rowwa.png) **Installation** -1. Get app_id and app_hash at [my.telegram.org](https://my.telegram.org/) 1. Swoole extension required: [Install swoole](https://github.com/swoole/swoole-src#%EF%B8%8F-installation) 1. `composer install` to install required libs 1. Create .env from .env.example 1. Fill variables in .env +1. Fill app_id and app_hash from [my.telegram.org](https://my.telegram.org/) + Or leave blank and MadelineProto will try to generate on start. _Optional:_ 1. Use supervisor to monitor and restart swoole servers. Example of `/etc/supervisor/conf.d/telegram_rss.conf`: diff --git a/bootstrap.php b/bootstrap.php index 128d34a..3f32eff 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,13 +1,12 @@ load(); diff --git a/composer.json b/composer.json index d4db780..b1e0494 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "xtrime-ru/telegramswooleclient", + "name": "xtrime-ru/telegramapiserver", "description": "Fast, simple, async php telegram client and parser: MadelineProto + Swoole Server", "type": "project", "homepage": "http://tg.i-c-a.su/", @@ -38,7 +38,7 @@ ], "autoload": { "psr-4": { - "TelegramSwooleClient\\": "src/" + "TelegramApiServer\\": "src/" } } } diff --git a/composer.lock b/composer.lock index 56503e3..ff47f3c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8aee7c1eb22cd664c077c858b8ce8bc7", + "content-hash": "411cf9adeea33d6ddccaef5634fcb8a7", "packages": [ { "name": "amphp/amp", diff --git a/server.php b/server.php index 0d779f9..1eb75de 100644 --- a/server.php +++ b/server.php @@ -47,5 +47,5 @@ if ($options['session']) { $sessionFile = "{$root}/session.madeline"; } -$client = new \TelegramSwooleClient\Client($sessionFile); -new TelegramSwooleClient\Server($client, $options); \ No newline at end of file +$client = new TelegramApiServer\Client($sessionFile); +new TelegramApiServer\Server($client, $options); \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index dd1ef59..c7d95cb 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,6 +1,6 @@