Skip to content

Commit

Permalink
Load the services from the package, not from the final application.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jun 17, 2020
1 parent 4f3d864 commit 8a65faa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Resources/config/routes/cas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cas_bundle:
resource: '@CasBundle/Resources/config/routes/routing.xml'
prefix: /cas
3 changes: 0 additions & 3 deletions Resources/config/routes/cas_bundle.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions src/DependencyInjection/CasExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace EcPhp\CasBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
Expand All @@ -21,6 +23,11 @@ public function load(array $configs, ContainerBuilder $container): void
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

// Load CAS configuration.
$container->setParameter('cas', $config);

// Load CAS services.
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.yaml');
}
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ services:
autowire: true

EcPhp\CasBundle\Controller\:
resource: '@CasBundle/Controller/'
resource: '../Controller/'
autowire: true
autoconfigure: true
tags: ['controller.service_arguments']
Expand Down

0 comments on commit 8a65faa

Please sign in to comment.