mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Added exception if .env not found (#734)
This commit is contained in:
parent
3d0dddb320
commit
f4150ef12c
1 changed files with 9 additions and 3 deletions
10
common.php
10
common.php
|
@ -63,9 +63,15 @@ function env(string $key, $default = null)
|
||||||
return \TorrentPier\Env::get($key, $default);
|
return \TorrentPier\Env::get($key, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get initial config
|
// Load ENV
|
||||||
|
try {
|
||||||
$dotenv = Dotenv\Dotenv::createMutable(BB_PATH);
|
$dotenv = Dotenv\Dotenv::createMutable(BB_PATH);
|
||||||
$dotenv->safeLoad();
|
$dotenv->load();
|
||||||
|
} catch (\Dotenv\Exception\InvalidPathException $pathException) {
|
||||||
|
die('Please rename from <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">.env.example</code> to <code style="background:#222;color:#00e01f;padding:2px 6px;border-radius:3px;">.env</code>, and configure it');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load config
|
||||||
require_once BB_PATH . '/library/config.php';
|
require_once BB_PATH . '/library/config.php';
|
||||||
|
|
||||||
// Local config
|
// Local config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue