Security update for permissions_by_term
[yaffs-website] / vendor / behat / behat / src / Behat / Testwork / Filesystem / ServiceContainer / FilesystemExtension.php
1 <?php
2
3 /*
4  * This file is part of the Behat Testwork.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Testwork\Filesystem\ServiceContainer;
12
13 use Behat\Testwork\Cli\ServiceContainer\CliExtension;
14 use Behat\Testwork\ServiceContainer\Extension;
15 use Behat\Testwork\ServiceContainer\ExtensionManager;
16 use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
17 use Symfony\Component\DependencyInjection\ContainerBuilder;
18 use Symfony\Component\DependencyInjection\Definition;
19 use Symfony\Component\DependencyInjection\Reference;
20
21 /**
22  * Provides filesystem services for testwork.
23  *
24  * @author Konstantin Kudryashov <ever.zet@gmail.com>
25  */
26 final class FilesystemExtension implements Extension
27 {
28     /*
29      * Available services
30      */
31     const LOGGER_ID = 'filesystem.logger';
32
33     /**
34      * {@inheritdoc}
35      */
36     public function getConfigKey()
37     {
38         return 'filesystem';
39     }
40
41     /**
42      * {@inheritdoc}
43      */
44     public function initialize(ExtensionManager $extensionManager)
45     {
46     }
47
48     /**
49      * {@inheritdoc}
50      */
51     public function configure(ArrayNodeDefinition $builder)
52     {
53     }
54
55     /**
56      * {@inheritdoc}
57      */
58     public function load(ContainerBuilder $container, array $config)
59     {
60         $this->loadFilesystemLogger($container);
61     }
62
63     /**
64      * {@inheritdoc}
65      */
66     public function process(ContainerBuilder $container)
67     {
68     }
69
70     /**
71      * Loads filesystem logger.
72      *
73      * @param ContainerBuilder $container
74      */
75     protected function loadFilesystemLogger(ContainerBuilder $container)
76     {
77         $definition = new Definition('Behat\Testwork\Filesystem\ConsoleFilesystemLogger', array(
78             '%paths.base%',
79             new Reference(CliExtension::OUTPUT_ID)
80         ));
81         $container->setDefinition(self::LOGGER_ID, $definition);
82     }
83 }