protected function setLdapConfigDefinition(ContainerBuilder $container, array $config)
    {
        $ldapCfg = ['general' => $config['general']];

        // Only tag the cache warmer if there are domains listed in the config...
        if (isset($config['domains']) && !empty($config['domains'])) {
            $ldapCfg['domains'] = $config['domains'];
            $container->getDefinition('ldap_tools.cache_warmer.ldap_tools_cache_warmer')->addTag('kernel.cache_warmer');
        } else {
            $container->getDefinition('data_collector.ldap_tools')->replaceArgument(0, null);
        }

        $definition = $container->getDefinition('LdapTools\Configuration');
        $definition->addMethodCall('loadFromArray', [$ldapCfg]);
        $definition->addMethodCall('setEventDispatcher', [new Reference('ldap_tools.event_dispatcher')]);

        $loggerChain = $container->getDefinition('ldap_tools.log.logger_chain');
        if ($config['logging']) {
            $loggerChain->addMethodCall('addLogger', [new Reference('ldap_tools.log.logger')]);
        }
        if ($config['profiling']) {
            $loggerChain->addMethodCall('addLogger', [new Reference('ldap_tools.log.profiler')]);
        }
        if ($config['logging'] || $config['profiling']) {
            $definition->addMethodCall('setLogger', [new Reference('ldap_tools.log.logger_chain')]);
        }
    }