<?php
/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
namespace Ibexa\Bundle\Rest;
use Ibexa\Bundle\Rest\DependencyInjection\Compiler;
use Ibexa\Bundle\Rest\DependencyInjection\Security\RestSessionBasedFactory;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class IbexaRestBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
parent::build($container);
$container->addCompilerPass(new Compiler\FieldTypeProcessorPass());
$container->addCompilerPass(new Compiler\InputHandlerPass());
$container->addCompilerPass(new Compiler\InputParserPass());
$container->addCompilerPass(new Compiler\OutputVisitorPass());
$container->addCompilerPass(new Compiler\ValueObjectVisitorPass());
/** @var \Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension $securityExtension */
$securityExtension = $container->getExtension('security');
$securityExtension->addSecurityListenerFactory(new RestSessionBasedFactory());
if ($container->hasExtension('lexik_jwt_authentication')) {
$container->addCompilerPass(new Compiler\LexikAuthorizationHeaderBridgePass());
}
}
}
class_alias(IbexaRestBundle::class, 'EzSystems\EzPlatformRestBundle\EzPlatformRestBundle');