From 7481b8308b7ccc2246905f3edcec032cdd7854c0 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Thu, 30 Mar 2023 14:44:56 -0400 Subject: [PATCH] - Some small fixes made to URL definition --- composer.json | 8 ++++++++ meta/definitions/template.php | 2 +- src/Kernel.php | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2a9a1fd..f88b59a 100644 --- a/composer.json +++ b/composer.json @@ -86,5 +86,13 @@ "psr-4": { "Lean\\": "src/" } + }, + "scripts": { + "post-install-cmd": [ + "Lean\\Composer::postInstall" + ], + "post-update-cmd": [ + "Lean\\Composer::postUpdate" + ] } } diff --git a/meta/definitions/template.php b/meta/definitions/template.php index 7ce69d7..8aa3b7b 100644 --- a/meta/definitions/template.php +++ b/meta/definitions/template.php @@ -65,7 +65,7 @@ return [ NumberExtension::class => autowire(NumberExtension::class), - UrlExtension::class => create(UrlExtension::class)->constructor(getenv("URL_BASE"), get('git.commit')), + UrlExtension::class => create(UrlExtension::class)->constructor(getenv("URL_BASE"), get('git.commit'), getenv('APP_URL'), (bool) getenv('FORCE_SSL')), Cache::class => create(Opcache::class)->constructor(getenv("CACHE_PATH"), get(Context::class)), diff --git a/src/Kernel.php b/src/Kernel.php index d99ebe0..68b71d1 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -61,7 +61,7 @@ class Kernel { Dotenv::create(getenv("PROJECT_PATH"))->load(); // Override using headers - if ( ( $keys = getenv('KEYS') ) && ( $auth = $_SERVER["HTTP_X_DEV_AUTH"] ?? null ) && in_array($auth, explode(',', $keys)) ) { + if ( ( $keys = getenv('KEYS') ) && ( $auth = $_SERVER["HTTP_X_DEV_AUTH"] ) && in_array($auth, explode(',', $keys)) ) { foreach (['APP_ENV', 'DEBUG',] as $env) { if (null !== $value = $_SERVER["HTTP_X_$env"] ?? null) { static::putenv($env, $value);