vendor/launchpad/backend/src/LaunchPadBundle.php line 13

Open in your IDE?
  1. <?php
  2. namespace LaunchPad\Bundle\LaunchPadBundle;
  3. use LaunchPad\Bundle\LaunchPadBundle\Base\Service\Utils\Storage\DependencyInjection\Compiler\ResolveFileHandlerPass;
  4. use LaunchPad\Bundle\LaunchPadBundle\DependencyInjection\LaunchPadExtension;
  5. use Symfony\Component\Config\FileLocator;
  6. use Symfony\Component\DependencyInjection\ContainerBuilder;
  7. use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
  8. use Symfony\Component\HttpKernel\Bundle\Bundle;
  9. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  10. class LaunchPadBundle extends Bundle
  11. {
  12.     /**
  13.      * @param ContainerBuilder $container
  14.      * @throws \Exception
  15.      */
  16.     public function build(ContainerBuilder $container)
  17.     {
  18.         $container->loadFromExtension('doctrine', [
  19.             'orm' => [
  20.                 'mappings' => [
  21.                     'LaunchPad' => [
  22.                         'dir' => "{$this->getPath()}/Base/Entity",
  23.                         'type' => 'annotation',
  24.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Entity',
  25.                     ],
  26.                     'Checkout' => [
  27.                         'is_bundle' => false,
  28.                         'dir' => "{$this->getPath()}/Base/Service/CardAquirer/Checkout/Entity",
  29.                         'type' => 'annotation',
  30.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\CardAquirer\Checkout\Entity',
  31.                     ],
  32.                     'OTP' => [
  33.                         'is_bundle' => false,
  34.                         'dir' => "{$this->getPath()}/Base/Service/OTP/Entity",
  35.                         'type' => 'annotation',
  36.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\OTP\Entity',
  37.                     ],
  38.                     'UserChallenge' => [
  39.                         'is_bundle' => false,
  40.                         'dir' => "{$this->getPath()}/Base/Service/UserChallenge/Entity",
  41.                         'type' => 'annotation',
  42.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\UserChallenge\Entity',
  43.                     ],
  44.                     'SCA' => [
  45.                         'is_bundle' => false,
  46.                         'dir' => "{$this->getPath()}/Base/Service/SCA/Entity",
  47.                         'type' => 'annotation',
  48.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\SCA\Entity',
  49.                     ],
  50.                     'Document' => [
  51.                         'is_bundle' => false,
  52.                         'dir' => "{$this->getPath()}/Base/Service/Document/Entity",
  53.                         'type' => 'annotation',
  54.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\Document\Entity',
  55.                     ],
  56.                     'XTM' => [
  57.                         'is_bundle' => false,
  58.                         'dir' => "{$this->getPath()}/Base/Service/Processor/XTM/Entity",
  59.                         'type' => 'annotation',
  60.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\Processor\XTM\Entity',
  61.                     ],
  62.                     'Accomplish' => [
  63.                         'is_bundle' => false,
  64.                         'dir' => "{$this->getPath()}/Base/Service/Processor/Accomplish/Entity",
  65.                         'type' => 'annotation',
  66.                         'prefix' => 'LaunchPad\Bundle\LaunchPadBundle\Base\Service\Processor\Accomplish\Entity',
  67.                     ],
  68.                 ]
  69.             ],
  70.             'dbal' => [],
  71.         ]);
  72.         $container->loadFromExtension('twig', [
  73.             'paths' => [
  74.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Resources/views' => 'WebsiteTemplates',
  75.                 '%kernel.project_dir%/vendor/launchpad/backend/src/External/Resources/views' => 'ExternalTemplates',
  76.                 // TODO: The OTP part could be loaded as module and move all this configuration there
  77. //                '%kernel.project_dir%/vendor/launchpad/backend/src/Base/Service/OTP/Resources/views' => 'OTPTemplates',
  78.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Base/Service/Processor/XTM/Resources/views' => 'XTMTemplates',
  79.             ],
  80.         ]);
  81.         $container->loadFromExtension('framework', [
  82.             'default_locale' => 'en',
  83.             'translator' => ['default_path' => '%kernel.project_dir%/translations'],
  84.             // ...
  85.         ]);
  86.         $loader = new YamlFileLoader(
  87.             $container,
  88.             new FileLocator($this->getPath().'/Resources/config')
  89.         );
  90.         $loader->load('services.yaml');
  91.         $loader->load('config.yaml');
  92.         $loader->load('security.yaml');
  93.         $loader->load('cors.yaml');
  94.         $loader->load('kyc.yaml');
  95.         $loader->load('email.yaml');
  96.         $loader->load('orm.yaml');
  97.         $loader->load('swiftmailer.yaml');
  98.         $loader->load('admin.yaml');
  99.         $loader->load('saltedge.yml');
  100.         $loader->load('swagger.yaml');
  101.         $uploadHandler $container->getParameter('upload_handler') ?  $container->getParameter('upload_handler') :'local';
  102.        // dump($uploadHandler);die;
  103.         $container->addCompilerPass(new ResolveFileHandlerPass($uploadHandler));
  104.     }
  105. }