2019-01-07 13:24:29 +01:00
|
|
|
<?php
|
|
|
|
//Check if autoload has been already loaded (in case plugin installed in existing project)
|
2019-01-21 20:37:24 +01:00
|
|
|
$root = __DIR__;
|
2019-01-07 13:24:29 +01:00
|
|
|
if (!class_exists('TelegramSwooleClient')) {
|
2019-01-21 20:37:24 +01:00
|
|
|
if (!file_exists($root . '/vendor/autoload.php')) {
|
|
|
|
$root = __DIR__ . '/../../..';
|
|
|
|
}
|
|
|
|
require $root . '/vendor/autoload.php';
|
|
|
|
chdir($root);
|
2019-01-07 13:24:29 +01:00
|
|
|
}
|
|
|
|
//Check if root env file hash been loaded (in case plugin installed in existing project)
|
2019-03-19 00:36:20 +01:00
|
|
|
if (!getenv('SWOOLE_SERVER_ADDRESS')) {
|
2019-05-15 00:31:11 +02:00
|
|
|
Dotenv\Dotenv::create($root, '.env')->load();
|
2019-01-07 13:24:29 +01:00
|
|
|
}
|