src/Company/BaseBundle/DependencyInjection/CompanyBaseExtension.php
author ymh <ymh.work@gmail.com>
Sun, 06 Nov 2011 23:44:37 +0100
changeset 27 1df556b2c0f9
parent 2 806e57d67020
permissions -rwxr-xr-x
Correct memory problem
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace Company\BaseBundle\DependencyInjection;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Symfony\Component\DependencyInjection\ContainerBuilder;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
use Symfony\Component\Config\FileLocator;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
use Symfony\Component\DependencyInjection\Loader;
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
/**
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
 * This is the class that loads and manages your bundle configuration
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
 *
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
 */
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
class CompanyBaseExtension extends Extension
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
{
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    /**
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
     * {@inheritDoc}
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
     */
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
    public function load(array $configs, ContainerBuilder $container)
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
    {
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
        $configuration = new Configuration();
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
        $config = $this->processConfiguration($configuration, $configs);
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
        $loader->load('services.yml');
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
    }
806e57d67020 Base Bundle commit
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
}