Skip to content
Permalink
Browse files

v2.0.0-beta.1 fixes (#213)

* Bugfixed controller as a service declaration

* Fixed config parameters types

* Ensure Symfony version >= 3.4
  • Loading branch information
yann-eugone committed Oct 2, 2019
1 parent cc446c9 commit 166c7d834181621131caf1aed55c06b058fa4d2b
@@ -41,14 +41,14 @@ public function getConfigTreeBuilder()
->children()
->scalarNode('generator')->defaultValue('presta_sitemap.generator_default')->end()
->scalarNode('dumper')->defaultValue('presta_sitemap.dumper_default')->end()
->scalarNode('timetolive')
->defaultValue('3600')
->integerNode('timetolive')
->defaultValue(3600)
->end()
->scalarNode('sitemap_file_prefix')
->defaultValue(self::DEFAULT_FILENAME)
->info('Sets sitemap filename prefix defaults to "sitemap" -> sitemap.xml (for index); sitemap.<section>.xml(.gz) (for sitemaps)')
->end()
->scalarNode('items_by_set')
->integerNode('items_by_set')
// Add one to the limit items value because it's an
// index value (not a quantity)
->defaultValue(XmlConstraint::LIMIT_ITEMS + 1)
@@ -32,25 +32,21 @@ public function load(array $configs, ContainerBuilder $container)
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load('services.xml');
$container->setParameter($this->getAlias() . '.dump_directory', $config['dump_directory']);
$container->setParameter($this->getAlias() . '.timetolive', $config['timetolive']);
$container->setParameter($this->getAlias() . '.sitemap_file_prefix', $config['sitemap_file_prefix']);
$container->setParameter($this->getAlias() . '.items_by_set', $config['items_by_set']);
$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', $config['default_section']);
$container->setParameter($this->getAlias() . '.default_section', (string)$config['default_section']);
if (true === $config['route_annotation_listener']) {
$loader->load('route_annotation_listener.xml');
}
$generator = $container->setAlias('presta_sitemap.generator', $config['generator']);
if ($generator !== null) {
$generator->setPublic(true); // in Symfony >=3.4.0 aliases are private
}
$generator->setPublic(true);
$dumper = $container->setAlias('presta_sitemap.dumper', $config['dumper']);
if ($dumper !== null) {
$dumper->setPublic(true); // in Symfony >=3.4.0 aliases are private
}
$dumper->setPublic(true);
}
}
@@ -1,11 +1,11 @@
PrestaSitemapBundle_index:
path: "/%presta_sitemap.sitemap_file_prefix%.{_format}"
defaults: { _controller: Presta\SitemapBundle\Controller\SitemapController::index }
defaults: { _controller: presta_sitemap.controller::indexAction }
requirements:
_format: xml

PrestaSitemapBundle_section:
path: "/%presta_sitemap.sitemap_file_prefix%.{name}.{_format}"
defaults: { _controller: Presta\SitemapBundle\Controller\SitemapController::section }
defaults: { _controller: presta_sitemap.controller::sectionAction }
requirements:
_format: xml
@@ -41,9 +41,9 @@

<service id="Presta\SitemapBundle\Service\DumperInterface" alias="presta_sitemap.dumper_default" />

<service id="presta_sitemap.controller" class="Presta\SitemapBundle\Controller\SitemapController">
<service id="presta_sitemap.controller" class="Presta\SitemapBundle\Controller\SitemapController" public="true">
<argument type="service" id="presta_sitemap.generator" />
<argument>%presta_sitemap.timetolive</argument>
<argument>%presta_sitemap.timetolive%</argument>
</service>
</services>

@@ -15,18 +15,18 @@
},
"require": {
"php": ">=7.1.0",
"symfony/framework-bundle": "~3.0|~4.0",
"symfony/console": "~3.0|~4.0"
"symfony/framework-bundle": "^3.4|~4.0",
"symfony/console": "^3.4|~4.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.0|~4.0",
"symfony/phpunit-bridge": "^3.4|~4.0",
"phpunit/phpunit": "7.*",
"symfony/security-bundle": "~3.0|~4.0",
"symfony/translation": "~3.0|~4.0",
"symfony/form": "~3.0|~4.0",
"symfony/validator": "~3.0|~4.0",
"symfony/browser-kit": "~3.0|~4.0",
"symfony/yaml": "~3.0|~4.0",
"symfony/security-bundle": "^3.4|~4.0",
"symfony/translation": "^3.4|~4.0",
"symfony/form": "^3.4|~4.0",
"symfony/validator": "^3.4|~4.0",
"symfony/browser-kit": "^3.4|~4.0",
"symfony/yaml": "^3.4|~4.0",
"doctrine/annotations": "~1.0"
},
"suggest": {

0 comments on commit 166c7d8

Please sign in to comment.
You can’t perform that action at this time.