I believe my configuration is correct, but I need the default values for the redis port parameter and the circuit configuration, but do they exit as zeros?
Can anyone understand what the problem is?

Here is my configuration.
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('company_name');
$rootNode
->children()
->arrayNode('cache')
->children()
->arrayNode('redis')
->addDefaultsIfNotSet()
->treatNullLike([
'scheme' => 'tcp',
'port' => 6379,
])
->children()
->scalarNode('scheme')
->defaultValue('tcp')
->end()
->scalarNode('host')
->isRequired()
->cannotBeEmpty()
->end()
->integerNode('port')
->defaultValue(6379)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
And here is my parameters.yml file
parameters:
company_name:
cache:
redis:
host: dev-sessionstore.companyname.com
schema: ~
port: ~
Console output:
$ php bin/console config:dump-reference CompanyNameCacheBundle
company_name:
cache:
redis:
namespace: apps
scheme: tcp
host: ~ # Required
port: 6379
apcu:
namespace: phpcache
I want the circuit and port to use the default values, but why were they empty?
source
share