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)
|
|
|
|
if (!getenv('SWOOLE_SERVER_ADDRESS')){
|
2019-01-21 20:37:24 +01:00
|
|
|
(new Dotenv\Dotenv($root))->load();
|
2019-01-07 13:24:29 +01:00
|
|
|
}
|