Skip to content

Commit

Permalink
fix: authCache needs namespace for each connection (#210)
Browse files Browse the repository at this point in the history
fix/auth-cache-dir
# Conflicts:
#	CHANGELOG.md
  • Loading branch information
taka-oyama committed May 21, 2024
1 parent a406f12 commit a65f680
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v7.4.1 (2024-05-21)

Fixed
- authCache needs namespace for each connection (#210)


# v7.4.0 (2024-05-13)

Added
Expand Down
6 changes: 3 additions & 3 deletions src/SpannerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ protected function parseConfig(array $config, string $name): array
}

/**
* @param array{ cache_path: string|null } $config
* @param array{ name: string, cache_path: string|null } $config
* @return AdapterInterface
*/
protected function createAuthCache(array $config): AdapterInterface
{
return $this->getCacheAdapter('_auth', $config['cache_path']);
return $this->getCacheAdapter($config['name'] . '_auth', $config['cache_path']);
}

/**
Expand All @@ -123,7 +123,7 @@ protected function createAuthCache(array $config): AdapterInterface
protected function createSessionPool(array $config): SessionPoolInterface
{
return new CacheSessionPool(
$this->getCacheAdapter($config['name'], $config['cache_path']),
$this->getCacheAdapter($config['name'] . '_sessions', $config['cache_path']),
$config['session_pool'],
);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/SpannerServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ public function test_change_cache_path(): void
$db->connection('main')->query()->select('SELECT 1');

$this->assertDirectoryExists($newPath);
$this->assertDirectoryExists("{$newPath}/main_sessions");
$this->assertDirectoryExists("{$newPath}/main_auth");
}
}

0 comments on commit a65f680

Please sign in to comment.