diff --git a/CHANGELOG.md b/CHANGELOG.md index 51dfc54ac..761ede29a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +### 10.0.6 (2024-01-07) + +#### Bugfixes + +* Fixed request bug that would occur if `PATH_INFO` was set but empty. + +#### Improvements + +* The framework now uses `mako\env` instead of `getenv`. + +-------------------------------------------------------- + ### 10.0.5 (2023-12-07) #### Bugfixes diff --git a/src/mako/application/Application.php b/src/mako/application/Application.php index 6e77fab02..39878f445 100644 --- a/src/mako/application/Application.php +++ b/src/mako/application/Application.php @@ -15,7 +15,7 @@ use function basename; use function date_default_timezone_set; -use function getenv; +use function mako\env; use function mb_internal_encoding; use function mb_language; use function mb_regex_encoding; @@ -221,7 +221,7 @@ public function isCommandLine(): bool */ public function getEnvironment(): ?string { - return getenv('MAKO_ENV') ?: null; + return env('MAKO_ENV') ?: null; } /** diff --git a/src/mako/cli/Environment.php b/src/mako/cli/Environment.php index fa8d7ffe1..ef87332e4 100644 --- a/src/mako/cli/Environment.php +++ b/src/mako/cli/Environment.php @@ -9,7 +9,7 @@ use function current; use function exec; -use function getenv; +use function mako\env; use function preg_match; /** @@ -51,7 +51,7 @@ protected function getDimensionsForUnixLike(): ?array { // Attempt to get dimensions from environment - if (($width = getenv('COLUMNS')) !== false && ($height = getenv('LINES')) !== false) { + if (($width = env('COLUMNS')) !== false && ($height = env('LINES')) !== false) { return ['width' => (int) $width, 'height' => (int) $height]; } @@ -100,7 +100,7 @@ public function getHeight(): int public function hasAnsiSupport(): bool { if ($this->hasAnsiSupport === null) { - $this->hasAnsiSupport = PHP_OS_FAMILY !== 'Windows' || (getenv('ANSICON') !== false || getenv('ConEmuANSI') === 'ON'); + $this->hasAnsiSupport = PHP_OS_FAMILY !== 'Windows' || (env('ANSICON') !== false || env('ConEmuANSI') === 'ON'); } return $this->hasAnsiSupport; diff --git a/src/mako/database/midgard/ORM.php b/src/mako/database/midgard/ORM.php index 9fc9d7405..80d8f5d14 100644 --- a/src/mako/database/midgard/ORM.php +++ b/src/mako/database/midgard/ORM.php @@ -213,7 +213,7 @@ public static function setConnectionManager(ConnectionManager $connectionManager public function getConnection(): Connection { if (empty(static::$connectionManager)) { - static::$connectionManager = Application::instance()->getContainer()->get('database'); + static::$connectionManager = Application::instance()->getContainer()->get(ConnectionManager::class); } return static::$connectionManager->getConnection($this->connectionName);