- Worked th error layout

- Added some picto for the error views
- Bugfixes
This commit is contained in:
Dave Mc Nicoll committed 2021-08-27 18:06:15 +00:00
1 parent 421024f260
commit fd693fc8fc
15 files changed
+101 -18

No files matched your search

+17 -7
View File
@@ -58,19 +58,25 @@ class Kernel {
// Environment vars (accessible from \DI\env(), getenv(), $_ENV and $_SERVER)
Dotenv::create(getenv("PROJECT_PATH"))->load();
// Paths and directories
foreach($this->paths as $name => $envkey) {
if ( ! getenv($name) ) {
static::putenv($name, realpath(getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . getenv($envkey)));
}
}
// Override using headers
foreach(['APP_ENV', 'DEBUG', ] as $env) {
if ( null !== $value = $_SERVER["HTTP_$env"] ?? null ) {
static::putenv($env, $value);
}
}
// Paths and directories
foreach($this->paths as $name => $envkey) {
if ( ! getenv($name) ) {
$path = getenv("PROJECT_PATH") . DIRECTORY_SEPARATOR . getenv($envkey);
if (getenv('DEBUG') && ! file_exists($path)) {
mkdir($path, 0755, true);
}
static::putenv($name, realpath($path));
}
}
}
protected function initializeEngine() : self
@@ -81,6 +87,10 @@ class Kernel {
setlocale(LC_ALL, $this->locale = getenv("DEFAULT_LOCAL"));
setlocale(LC_TIME, getenv("DEFAULT_TIME"), getenv("DEFAULT_TIME_FALLBACK"));
if ( class_exists('Locale') ) {
\Locale::setDefault($this->locale);
}
ini_set("log_errors", "1");
ini_set("error_log", $this->errorLogPath);
ini_set('display_errors', getenv("DEBUG") ? 'on' : 'on');