Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move setting of parameters before loading services #349

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/DependencyInjection/PrestaSitemapExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ public function load(array $configs, ContainerBuilder $container): void
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.xml');

$container->setParameter($this->getAlias() . '.dump_directory', (string)$config['dump_directory']);
$container->setParameter($this->getAlias() . '.timetolive', (int)$config['timetolive']);
$container->setParameter($this->getAlias() . '.sitemap_file_prefix', (string)$config['sitemap_file_prefix']);
$container->setParameter($this->getAlias() . '.items_by_set', (int)$config['items_by_set']);
$container->setParameter($this->getAlias() . '.defaults', $config['defaults']);
$container->setParameter($this->getAlias() . '.default_section', (string)$config['default_section']);

$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../../config'));
$loader->load('services.xml');

if (true === $config['route_annotation_listener']) {
$loader->load('route_annotation_listener.xml');

Expand Down
2 changes: 0 additions & 2 deletions tests/Integration/tests/BaseSitemapTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
use PHPUnit\Framework\Assert;
use Presta\SitemapBundle\Tests\Integration\Kernel;
use SimpleXMLElement;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\DependencyInjection\ContainerInterface;

abstract class BaseSitemapTestCase extends WebTestCase
{
Expand Down
Loading