]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/FederationBundle/DependencyInjection/WallabagFederationExtension.php
WIP
[github/wallabag/wallabag.git] / src / Wallabag / FederationBundle / DependencyInjection / WallabagFederationExtension.php
diff --git a/src/Wallabag/FederationBundle/DependencyInjection/WallabagFederationExtension.php b/src/Wallabag/FederationBundle/DependencyInjection/WallabagFederationExtension.php
new file mode 100644 (file)
index 0000000..ceeb837
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+
+namespace Wallabag\FederationBundle\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+use Symfony\Component\DependencyInjection\Loader;
+
+class WallabagFederationExtension extends Extension
+{
+    public function load(array $configs, ContainerBuilder $container)
+    {
+        $configuration = new Configuration();
+        $config = $this->processConfiguration($configuration, $configs);
+
+        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
+        $loader->load('services.yml');
+        $container->setParameter('wallabag_user.registration_enabled', $config['registration_enabled']);
+    }
+
+    public function getAlias()
+    {
+        return 'wallabag_federation';
+    }
+}