- Some small fixes made to URL definition

This commit is contained in:
Dave M. 2023-03-30 14:44:56 -04:00
parent 778cdcc7af
commit 7481b8308b
3 changed files with 10 additions and 2 deletions

View File

@ -86,5 +86,13 @@
"psr-4": {
"Lean\\": "src/"
}
},
"scripts": {
"post-install-cmd": [
"Lean\\Composer::postInstall"
],
"post-update-cmd": [
"Lean\\Composer::postUpdate"
]
}
}

View File

@ -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)),

View File

@ -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);