Skip to content

Commit 9e5bc02

Browse files
committed
aligned configuration with other Bundles
1 parent 4afd995 commit 9e5bc02

File tree

6 files changed

+37
-26
lines changed

6 files changed

+37
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Changelog
22
=========
33

4+
* **2013-07-29**: [DependencyInjection] restructured `phpcr_provider` config into `persistence` -> `phpcr` to match other Bundles
45
* **2013-07-28**: [DependencyInjection] added `enabled` flag to `phpcr_provider` config
56
* **2013-07-26**: [Model] Deprecated setRouteContent and getRouteContent, use setContent and getContent instead.
67
* **2013-07-19**: [Model] Separated database agnostic, doctrine generic and

DependencyInjection/CmfRoutingExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
8888

8989
$hasProvider = false;
9090
$hasContentRepository = false;
91-
if (!empty($config['phpcr_provider']['enabled'])) {
92-
$this->loadPhpcrProvider($config['phpcr_provider'], $loader, $container);
91+
if (!empty($config['persistence']['phpcr']['enabled'])) {
92+
$this->loadPhpcrProvider($config['persistence']['phpcr'], $loader, $container);
9393
$hasProvider = true;
9494
$hasContentRepository = true;
9595
}

DependencyInjection/Configuration.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,19 @@ public function getConfigTreeBuilder()
5858
->useAttributeAsKey('alias')
5959
->prototype('scalar')->end()
6060
->end()
61-
->arrayNode('phpcr_provider')
61+
->arrayNode('persistence')
6262
->children()
63-
->scalarNode('enabled')->defaultNull()->end()
64-
->scalarNode('manager_name')->defaultNull()->end()
65-
->scalarNode('route_basepath')->defaultValue('/cms/routes')->end()
66-
->scalarNode('content_basepath')->defaultValue('/cms/content')->end()
67-
->enumNode('use_sonata_admin')
68-
->values(array(true, false, 'auto'))
69-
->defaultValue('auto')
63+
->arrayNode('phpcr')
64+
->children()
65+
->scalarNode('enabled')->defaultNull()->end()
66+
->scalarNode('manager_name')->defaultNull()->end()
67+
->scalarNode('route_basepath')->defaultValue('/cms/routes')->end()
68+
->scalarNode('content_basepath')->defaultValue('/cms/content')->end()
69+
->enumNode('use_sonata_admin')
70+
->values(array(true, false, 'auto'))
71+
->defaultValue('auto')
72+
->end()
73+
->end()
7074
->end()
7175
->end()
7276
->end()

Tests/DependencyInjection/CmfRoutingExtensionTest.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ public function testLoadDefault()
2828
array(
2929
array(
3030
'dynamic' => array(
31-
'phpcr_provider' => array(
32-
'enabled' => true,
33-
'use_sonata_admin' => false,
31+
'persistence' => array(
32+
'phpcr' => array(
33+
'enabled' => true,
34+
'use_sonata_admin' => false,
35+
),
3436
),
3537
),
3638
)
@@ -79,8 +81,10 @@ public function testLoadConfigured()
7981
'dynamic' => array(
8082
'route_provider_service_id' => 'test_route_provider_service',
8183
'content_repository_service_id' => 'test_content_repository_service',
82-
'phpcr_provider' => array(
83-
'use_sonata_admin' => false,
84+
'persistence' => array(
85+
'phpcr' => array(
86+
'use_sonata_admin' => false,
87+
),
8488
),
8589
),
8690
'chain' => array(

Tests/Functional/config/cmf-routing.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ cmf_routing:
1111
Symfony\Cmf\Bundle\RoutingBundle\Doctrine\Phpcr\RedirectRoute: cmf_routing.redirect_controller:redirectAction
1212
templates_by_class:
1313
Symfony\Cmf\Bundle\RoutingBundle\Tests\Functional\Testdoc\Content: TestBundle:Content:index.html.twig
14-
phpcr_provider:
15-
enabled: true
16-
route_basepath: /test/routing
14+
persistence:
15+
phpcr:
16+
enabled: true
17+
route_basepath: /test/routing

UPGRADE-1.1.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ Deprecated `RoutingBundle\Document\Route` and `RedirectRoute` in favor of
77
PHPCR specific configurations moved into
88

99
dynamic:
10-
phpcr_provider:
11-
enabled: true
12-
# the rest is optional, the defaults are
13-
route_basepath: ~
14-
manager_name: ~
15-
content_basepath: ~
16-
use_sonata_admin: auto
10+
persistence:
11+
phpcr:
12+
enabled: true
13+
# the rest is optional, the defaults are
14+
route_basepath: ~
15+
manager_name: ~
16+
content_basepath: ~
17+
use_sonata_admin: auto
1718

18-
You need to at least set `phpcr_provider.enabled: true` to have the PHPCR provider loaded.
19+
You need to at least set `persistence.phpcr.enabled: true` to have the PHPCR provider loaded.
1920

2021
Dropped redundant unused `routing_repositoryroot` configuration.
2122

0 commit comments

Comments
 (0)