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.                 ]
  57.             ],
  58.             'dbal' => [],
  59.         ]);
  60.         $container->loadFromExtension('twig', [
  61.             'paths' => [
  62.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Resources/views' => 'WebsiteTemplates',
  63.                 '%kernel.project_dir%/vendor/launchpad/backend/src/External/Resources/views' => 'ExternalTemplates',
  64.                 // TODO: The OTP part could be loaded as module and move all this configuration there
  65.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Base/Service/OTP/Resources/views' => 'OTPTemplates',
  66.             ],
  67.         ]);
  68.         $container->loadFromExtension('framework', [
  69.             'default_locale' => 'en',
  70.             'translator' => ['default_path' => '%kernel.project_dir%/translations'],
  71.             // ...
  72.         ]);
  73.         $loader = new YamlFileLoader(
  74.             $container,
  75.             new FileLocator($this->getPath().'/Resources/config')
  76.         );
  77.         $loader->load('services.yaml');
  78.         $loader->load('config.yaml');
  79.         $loader->load('security.yaml');
  80.         $loader->load('cors.yaml');
  81.         $loader->load('kyc.yaml');
  82.         $loader->load('email.yaml');
  83.         $loader->load('orm.yaml');
  84.         $loader->load('swiftmailer.yaml');
  85.         $loader->load('admin.yaml');
  86.         $loader->load('saltedge.yml');
  87.         $loader->load('swagger.yaml');
  88.         $uploadHandler $container->getParameter('upload_handler') ?  $container->getParameter('upload_handler') :'local';
  89.        // dump($uploadHandler);die;
  90.         $container->addCompilerPass(new ResolveFileHandlerPass($uploadHandler));
  91.     }
  92. }