File tree Expand file tree Collapse file tree 4 files changed +53
-1
lines changed
Resources/Fixtures/config Expand file tree Collapse file tree 4 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 22
33The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44
5+ # 1.26.0 - 2022-03-17
6+
7+ - Fixed you can now configure the cache plugin default_ttl with ` null ` .
8+
59# 1.25.0 - 2021-11-26
610- Added PHP 8.1 support
711- Added Symfony 6 support
Original file line number Diff line number Diff line change @@ -713,8 +713,14 @@ private function createCachePluginNode()
713713 ->integerNode ('cache_lifetime ' )
714714 ->info ('The minimum time we should store a cache item ' )
715715 ->end ()
716- ->integerNode ('default_ttl ' )
716+ ->scalarNode ('default_ttl ' )
717717 ->info ('The default max age of a Response ' )
718+ ->validate ()
719+ ->ifTrue (function ($ v ) {
720+ return null !== $ v && !is_int ($ v );
721+ })
722+ ->thenInvalid ('default_ttl must be an integer or null, got %s ' )
723+ ->end ()
718724 ->end ()
719725 ->arrayNode ('blacklisted_paths ' )
720726 ->info ('An array of regular expression patterns for paths not to be cached. Defaults to an empty array. ' )
Original file line number Diff line number Diff line change 1+ httplug :
2+ clients :
3+ test :
4+ plugins :
5+ -
6+ cache :
7+ cache_pool : my_custom_cache_pull
8+ config :
9+ default_ttl : null
Original file line number Diff line number Diff line change @@ -453,4 +453,37 @@ public function testInvalidCapturedBodyLengthString(): void
453453 $ this ->expectExceptionMessage ('The child node "captured_body_length" at path "httplug.profiling" must be an integer or null ' );
454454 $ this ->assertProcessedConfigurationEquals ([], [$ file ]);
455455 }
456+
457+ public function testNullDefaultTtl (): void
458+ {
459+ $ file = __DIR__ .'/../../Resources/Fixtures/config/ttl_null.yml ' ;
460+ $ config = $ this ->emptyConfig ;
461+ $ config ['clients ' ] = [
462+ 'test ' => [
463+ 'factory ' => 'httplug.factory.auto ' ,
464+ 'service ' => null ,
465+ 'public ' => null ,
466+ 'flexible_client ' => false ,
467+ 'http_methods_client ' => false ,
468+ 'batch_client ' => false ,
469+ 'config ' => [],
470+ 'plugins ' => [
471+ [
472+ 'cache ' => [
473+ 'config ' => [
474+ 'default_ttl ' => null ,
475+ 'blacklisted_paths ' => [],
476+ 'methods ' => ['GET ' , 'HEAD ' ],
477+ 'cache_listeners ' => [],
478+ ],
479+ 'cache_pool ' => 'my_custom_cache_pull ' ,
480+ 'enabled ' => true ,
481+ 'stream_factory ' => 'httplug.stream_factory ' ,
482+ ],
483+ ],
484+ ],
485+ ],
486+ ];
487+ $ this ->assertProcessedConfigurationEquals ($ config , [$ file ]);
488+ }
456489}
You can’t perform that action at this time.
0 commit comments