From 614ca2dc11cadc19c1d8088a7e5f70ca1ecc79b9 Mon Sep 17 00:00:00 2001 From: Alexander Pankratov Date: Mon, 21 Jan 2019 22:37:24 +0300 Subject: [PATCH] Update for use in external projects via composer. --- bootstrap.php | 9 +++++++-- server.php | 2 +- src/Client.php | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bootstrap.php b/bootstrap.php index 6966cc8..7ba42cf 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -1,9 +1,14 @@ load(); + (new Dotenv\Dotenv($root))->load(); } diff --git a/server.php b/server.php index e963b9c..fec5a23 100644 --- a/server.php +++ b/server.php @@ -41,5 +41,5 @@ Example: exit; } -$client = new \TelegramSwooleClient\Client(); +$client = new \TelegramSwooleClient\Client($root); new TelegramSwooleClient\Server($client, $options); \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index 7bf2764..9406e5f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -11,9 +11,9 @@ class Client { /** * Client constructor. */ - public function __construct() + public function __construct($root) { - $sessionFile = __DIR__ . '/../session.madeline'; + $sessionFile = $root . '/session.madeline'; $config = Config::getInstance()->getConfig('telegram');