Skip to content

Commit

Permalink
Prevent the logger service from starting the session unnecessarily
Browse files Browse the repository at this point in the history
  • Loading branch information
freost committed Nov 9, 2023
1 parent 077b7b5 commit 4ff8e95
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
### 9.1.3 <small>(2023-11-09)</small>

#### Bugfixes

* The logger service will no longer start the session unnecessarily if the gatekeeper service is enabled.

--------------------------------------------------------

### 9.1.2 <small>(2023-09-12)</small>

#### Bugfixes

* The `mako\env()` function now works as expected with the falsy boolean value defined as "0"
* The `mako\env()` function now works as expected with the falsy boolean value defined as "0".

--------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions src/mako/Mako.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Mako
*
* @var string
*/
public const VERSION = '9.1.2';
public const VERSION = '9.1.3';

/**
* Mako major version.
Expand All @@ -38,5 +38,5 @@ class Mako
*
* @var int
*/
public const VERSION_PATCH = 2;
public const VERSION_PATCH = 3;
}
2 changes: 1 addition & 1 deletion src/mako/application/services/LoggerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function getUserContext(): ?array
{
$user = ['ip_address' => $this->container->get(Request::class)->getIp()];

if($this->container->has(Gatekeeper::class) && ($gatekeeperUser = $this->container->get(Gatekeeper::class)->getUser()) !== null)
if($this->container->hasInstanceOf(Gatekeeper::class) && ($gatekeeperUser = $this->container->get(Gatekeeper::class)->getUser()) !== null)
{
$user += ['id' => $gatekeeperUser->getId(), 'username' => $gatekeeperUser->getUsername()];
}
Expand Down

0 comments on commit 4ff8e95

Please sign in to comment.