Newscoop\NewscoopBundle\DependencyInjection\NewscoopNewscoopExtension::prepend PHP Метод

prepend() публичный Метод

public prepend ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function prepend(ContainerBuilder $container)
    {
        global $Campsite;
        $this->mergeParameters($container);
        $containerParameters = $container->getParameterBag()->all();
        $config_file = APPLICATION_PATH . '/../conf/database_conf.php';
        if (is_readable($config_file)) {
            require_once $config_file;
        }
        $doctrine_dbal_config = array('default_connection' => 'default', 'connections' => array('default' => array('dbname' => $Campsite['DATABASE_NAME'], 'host' => $Campsite['DATABASE_SERVER_ADDRESS'], 'port' => $Campsite['DATABASE_SERVER_PORT'], 'user' => $Campsite['DATABASE_USER'], 'password' => $Campsite['DATABASE_PASSWORD'], 'driver' => 'pdo_mysql', 'charset' => 'UTF8', 'mapping_types' => array('enum' => 'string', 'point' => 'string', 'geometry' => 'string'))));
        $doctrine_orm_config = array('auto_generate_proxy_classes' => $containerParameters['doctrine']['proxy']['autogenerate'], 'proxy_namespace' => $containerParameters['doctrine']['proxy']['namespace'], 'proxy_dir' => $this->truepath($containerParameters['doctrine']['proxy']['dir']), 'default_entity_manager' => 'default', 'entity_managers' => array('default' => array('connection' => 'default', 'auto_mapping' => false, 'mappings' => array('newscoop_entity' => array('mapping' => 'true', 'type' => 'annotation', 'dir' => $this->truepath($containerParameters['doctrine']['entity']['dir']), 'is_bundle' => false, 'prefix' => 'Newscoop\\Entity'), 'newscoop_package' => array('mapping' => 'true', 'type' => 'annotation', 'dir' => $this->truepath($containerParameters['doctrine']['entity']['dir']), 'is_bundle' => false, 'prefix' => 'Newscoop\\Package'), 'newscoop_image' => array('mapping' => 'true', 'type' => 'annotation', 'dir' => $this->truepath($containerParameters['doctrine']['entity']['dir']), 'is_bundle' => false, 'prefix' => 'Newscoop\\Image'), 'newscoop_subscription' => array('mapping' => 'true', 'type' => 'annotation', 'dir' => $this->truepath($containerParameters['doctrine']['entity']['dir']), 'is_bundle' => false, 'prefix' => 'Newscoop\\Subscription')), 'metadata_cache_driver' => $containerParameters['doctrine']['cache'], 'query_cache_driver' => $containerParameters['doctrine']['cache'], 'dql' => array('numeric_functions' => $containerParameters['doctrine']['functions']))));
        $container->prependExtensionConfig('doctrine', array('dbal' => $doctrine_dbal_config, 'orm' => $doctrine_orm_config));
    }