<?php

namespace Bundle\ApcBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ApcExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->process($configuration->getConfigTree(), $configs);

        $container->setParameter('apc.host', trim($config['host'], '/'));
        $container->setParameter('apc.web_dir', $config['web_dir']);
    }
}

<?php

namespace Bundle\ApcBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;

class ApcExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->process($configuration->getConfigTree(), $configs);

        if (strncmp($config['host'], 'http', 4) !== 0) {
            $config['host'] = 'http://'.$config['host'];
        }
        $container->setParameter('apc.host', trim($config['host'], '/'));
        $container->setParameter('apc.web_dir', $config['web_dir']);
    }
}

Add http protocol to host config
Add http protocol to host config
