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.                 ]
  39.             ],
  40.             'dbal' => [],
  41.         ]);
  42.         $container->loadFromExtension('twig', [
  43.             'paths' => [
  44.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Resources/views' => 'WebsiteTemplates',
  45.                 '%kernel.project_dir%/vendor/launchpad/backend/src/External/Resources/views' => 'ExternalTemplates',
  46.                 // TODO: The OTP part could be loaded as module and move all this configuration there
  47.                 '%kernel.project_dir%/vendor/launchpad/backend/src/Base/Service/OTP/Resources/views' => 'OTPTemplates',
  48.             ],
  49.         ]);
  50.         $container->loadFromExtension('framework', [
  51.             'default_locale' => 'en',
  52.             'translator' => ['default_path' => '%kernel.project_dir%/translations'],
  53.             // ...
  54.         ]);
  55.         $loader = new YamlFileLoader(
  56.             $container,
  57.             new FileLocator($this->getPath().'/Resources/config')
  58.         );
  59.         $loader->load('services.yaml');
  60.         $loader->load('config.yaml');
  61.         $loader->load('security.yaml');
  62.         $loader->load('cors.yaml');
  63.         $loader->load('kyc.yaml');
  64.         $loader->load('email.yaml');
  65.         $loader->load('orm.yaml');
  66.         $loader->load('swiftmailer.yaml');
  67.         $loader->load('admin.yaml');
  68.         $uploadHandler $container->getParameter('upload_handler') ?  $container->getParameter('upload_handler') :'local';
  69.        // dump($uploadHandler);die;
  70.         $container->addCompilerPass(new ResolveFileHandlerPass($uploadHandler));
  71.     }
  72. }