diff --git a/public/patchwork.php b/public/patchwork.php index 919d72a..f50ea72 100644 --- a/public/patchwork.php +++ b/public/patchwork.php @@ -2,10 +2,12 @@ // import functions require_once '../src/functions.php'; -// load Lastfm APIKEY from .env -require_once realpath(__DIR__ . "/../vendor/autoload.php"); -$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . "/.."); -$dotenv->load(); +if (!isset($_ENV["LASTFM_API_KEY"])) { + // load Lastfm APIKEY from .env + require_once realpath(__DIR__ . "/../vendor/autoload.php"); + $dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . "/.."); + $dotenv->load(); +} $apiKey = $_ENV['LASTFM_API_KEY'];