Sulu\Bundle\CoreBundle\DependencyInjection\SuluCoreExtension::prepend PHP Метод

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

public prepend ( ContainerBuilder $container )
$container Symfony\Component\DependencyInjection\ContainerBuilder
    public function prepend(ContainerBuilder $container)
    {
        // process the configuration of SuluCoreExtension
        $configs = $container->getExtensionConfig($this->getAlias());
        $parameterBag = $container->getParameterBag();
        $configs = $parameterBag->resolveValue($configs);
        $config = $this->processConfiguration(new Configuration(), $configs);
        if (isset($config['phpcr']) && $container->hasExtension('doctrine_phpcr')) {
            $phpcrConfig = $config['phpcr'];
            // TODO: Workaround for issue: https://github.com/doctrine/DoctrinePHPCRBundle/issues/178
            if (!isset($phpcrConfig['backend']['check_login_on_server'])) {
                $phpcrConfig['backend']['check_login_on_server'] = false;
            }
            $container->prependExtensionConfig('doctrine_phpcr', ['session' => $phpcrConfig, 'odm' => []]);
        }
        $templatesPath = '%kernel.root_dir%/../vendor/sulu/sulu/src/Sulu/Bundle/CoreBundle/Content/templates';
        $container->prependExtensionConfig('sulu_core', ['content' => ['structure' => ['paths' => ['sulu' => ['path' => $templatesPath, 'type' => 'page']]]]]);
        if ($container->hasExtension('massive_build')) {
            $container->prependExtensionConfig('massive_build', ['command_class' => 'Sulu\\Bundle\\CoreBundle\\CommandOptional\\SuluBuildCommand']);
        }
        if ($container->hasExtension('fos_rest')) {
            $container->prependExtensionConfig('fos_rest', ['routing_loader' => ['default_format' => 'json'], 'exception' => ['enabled' => true, 'codes' => [MissingParameterException::class => 400, InvalidHashException::class => 409, ObjectNotSupportedException::class => 406]], 'service' => ['exception_handler' => 'sulu_core.rest.exception_wrapper_handler']]);
        }
        if ($container->hasExtension('doctrine')) {
            $container->prependExtensionConfig('doctrine', ['orm' => ['mappings' => ['gedmo_tree' => ['type' => 'xml', 'prefix' => 'Gedmo\\Tree\\Entity', 'dir' => '%kernel.root_dir%/../vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity', 'alias' => 'GedmoTree', 'is_bundle' => false]], 'dql' => ['string_functions' => ['group_concat' => GroupConcat::class, 'CAST' => Cast::class]], 'resolve_target_entities' => [CollectionInterface::class => Collection::class, AccountInterface::class => Account::class]]]);
        }
        if ($container->hasExtension('stof_doctrine_extensions')) {
            $container->prependExtensionConfig('stof_doctrine_extensions', ['orm' => ['default' => ['tree' => true]]]);
        }
        if ($container->hasExtension('jms_serializer')) {
            $container->prependExtensionConfig('jms_serializer', ['metadata' => ['debug' => '%kernel.debug%']]);
        }
        if ($container->hasExtension('cmf_core')) {
            $container->prependExtensionConfig('cmf_core', ['publish_workflow' => ['enabled' => false]]);
        }
        if ($container->hasExtension('fos_rest')) {
            $container->prependExtensionConfig('fos_rest', ['view' => ['formats' => ['json' => true, 'csv' => true]]]);
        }
        if ($container->hasExtension('massive_build')) {
            $container->prependExtensionConfig('massive_build', ['targets' => ['prod' => ['dependencies' => ['database' => [], 'phpcr' => [], 'fixtures' => [], 'phpcr_migrations' => [], 'system_collections' => []]], 'dev' => ['dependencies' => ['database' => [], 'fixtures' => [], 'phpcr' => [], 'user' => [], 'phpcr_migrations' => [], 'system_collections' => []]], 'maintain' => ['dependencies' => ['node_order' => [], 'search_index' => [], 'phpcr_migrations' => []]]]]);
        }
    }