Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: authCache needs namespace for each connection #210

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Added
- Support for `INSERT OR IGNORE` (#207)
- Support adding request timeout at query level (#208)

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

# v8.0.0 (2024-04-11)

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");
}
}
Loading