Skip to content

Commit

Permalink
Merge pull request #571 from laravel-doctrine/cache-default-lifetime
Browse files Browse the repository at this point in the history
Support override default lifetime for cache
  • Loading branch information
eigan authored Dec 22, 2023
2 parents 30e83ee + 3bd57eb commit 6922f00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions config/doctrine.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@
'namespace' => null,
'metadata' => [
'driver' => env('DOCTRINE_METADATA_CACHE', env('DOCTRINE_CACHE', 'array')),
'namespace' => null,
'namespace' => 'metadata',
],
'query' => [
'driver' => env('DOCTRINE_QUERY_CACHE', env('DOCTRINE_CACHE', 'array')),
'namespace' => null,
'namespace' => 'query',
],
'result' => [
'driver' => env('DOCTRINE_RESULT_CACHE', env('DOCTRINE_CACHE', 'array')),
'namespace' => null,
'namespace' => 'result',
],
],
/*
Expand Down
4 changes: 2 additions & 2 deletions src/Configuration/Cache/IlluminateCacheProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class IlluminateCacheProvider implements Driver
* @var string
*/
protected $store;

/**
* @param Factory $cache
*/
Expand All @@ -42,7 +42,7 @@ public function resolve(array $settings = []): CacheItemPoolInterface
trigger_error('Using driver "' . $this->store . '" with a custom store is deprecated. Please use the "illuminate" driver.', E_USER_DEPRECATED);
}

return new Psr16Adapter($this->cache->store($store), $settings['namespace'] ?? '');
return new Psr16Adapter($this->cache->store($store), $settings['namespace'] ?? '', $settings['default_lifetime'] ?? 0);
}

public function getStore(): string
Expand Down

0 comments on commit 6922f00

Please sign in to comment.