1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Azine\JsCryptoStoreBundle\DependencyInjection; |
4
|
|
|
|
5
|
|
|
use Symfony\Component\Config\FileLocator; |
6
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
7
|
|
|
use Symfony\Component\DependencyInjection\Loader; |
8
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Configure the bundle with the values from the config.yml/.xml. |
12
|
|
|
*/ |
13
|
|
|
class AzineJsCryptoStoreExtension extends Extension |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* {@inheritdoc} |
17
|
|
|
*/ |
18
|
|
|
public function load(array $configs, ContainerBuilder $container) |
19
|
|
|
{ |
20
|
|
|
$configuration = new Configuration(); |
21
|
|
|
$config = $this->processConfiguration($configuration, $configs); |
22
|
|
|
|
23
|
|
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
24
|
|
|
$loader->load('services.yml'); |
25
|
|
|
$container->setParameter('azine_js_crypto_store.encryptionCipher', $config['encryptionCipher']); |
26
|
|
|
$container->setParameter('azine_js_crypto_store.encryptionMode', $config['encryptionMode']); |
27
|
|
|
$container->setParameter('azine_js_crypto_store.encryptionIterations', $config['encryptionIterations']); |
28
|
|
|
$container->setParameter('azine_js_crypto_store.encryptionKs', $config['encryptionKs']); |
29
|
|
|
$container->setParameter('azine_js_crypto_store.encryptionTs', $config['encryptionTs']); |
30
|
|
|
$container->setParameter('azine_js_crypto_store.maxFileSize', $config['maxFileSize']); |
31
|
|
|
$container->setParameter('azine_js_crypto_store.defaultLifeTime', $config['defaultLifeTime']); |
32
|
|
|
|
33
|
|
|
$container->setAlias('azine_js_crypto_store.ownerProvider', $config['ownerProvider']); |
34
|
|
|
} |
35
|
|
|
} |
36
|
|
|
|