vendor/uvdesk/mailbox-component/DependencyInjection/UVDeskExtension.php line 17

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\MailboxBundle\DependencyInjection;
  3. use Symfony\Component\Config\FileLocator;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  6. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  7. class UVDeskExtension extends Extension
  8. {
  9.     public function getAlias()
  10.     {
  11.         return 'uvdesk_mailbox';
  12.     }
  13.     public function getConfiguration(array $configsContainerBuilder $container)
  14.     {
  15.         return new Configuration();
  16.     }
  17.     public function load(array $configsContainerBuilder $container)
  18.     {
  19.         $loader = new YamlFileLoader($container, new FileLocator(__DIR__ '/../Resources/config'));
  20.         $loader->load('services.yaml');
  21.         // Load bundle configurations
  22.         $configuration $this->getConfiguration($configs$container);
  23.         foreach ($this->processConfiguration($configuration$configs) as $param => $value) {
  24.             switch ($param) {
  25.                 case 'emails':
  26.                     foreach ($value as $field => $fieldValue) {
  27.                         $container->setParameter("uvdesk.emails.$field"$fieldValue);
  28.                     }
  29.                     break;
  30.                 case 'mailboxes':
  31.                     $container->setParameter("uvdesk.mailboxes"array_keys($value));
  32.                     foreach ($value as $mailboxId => $mailboxDetails) {
  33.                         $mailboxDetails['email'] = $mailboxDetails['imap_server']['username'];
  34.                         
  35.                         $container->setParameter("uvdesk.mailboxes.$mailboxId"$mailboxDetails);
  36.                     }
  37.                     break;
  38.                 default:
  39.                     break;
  40.             }
  41.         }
  42.     }
  43. }