Skip to content

Commit

Permalink
remove unused content_basepath from phpcr configuration
Browse files Browse the repository at this point in the history
this configuration is only used in the sonata admin
  • Loading branch information
dbu committed Feb 3, 2017
1 parent 99576cc commit f6b028c
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Changelog
=========

* **2017-02-03**: [BC BREAK] Removed unused `cmf_routing.dynamic.persistence.phpcr.content_basepath`

2.0.0-RC1
---------

Expand Down
45 changes: 45 additions & 0 deletions UPGRADE-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,51 @@
- cmf_sonata_admin_integration.routing.redirect_route_admin
```
* The settings `admin_basepath` and `content_basepath` are only relevant for the admin and thus have been moved as well.

**Before**
```yaml
cmf_routing:
# ...
dynamic:
persistence:
phpcr:
admin_basepath: '/cms/routes'
content_basepath: '/cms/content'
```
```xml
<config xmlns="http://cmf.symfony.com/schema/dic/routing">
<dynamic>
<persistence>
<phpcr
admin-basepath="/cms/routes"
content-basepath="/cms/content"
/>
</persistence>
</dynamic>
</config>
```

**After**
```yaml
cmf_sonata_phpcr_admin_integration:
# ...
bundles:
routing:
basepath: '/cms/routes'
content_basepath: '/cms/content'
```
```xml
<config xmlns="http://cmf.symfony.com/schema/dic/sonata-phpcr-admin-integration">
<bundles>
<routing
basepath="/cms/routes"
content-basepath="/cms/content"
/>
</bundles>
</config>
```

## Route Model

* Removed `getAddFormatPattern()`/`setAddFormatPattern()` from the model
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
"suggest": {
"doctrine/phpcr-odm": "To enable support for the PHPCR ODM documents (^1.4)",
"doctrine/phpcr-bundle": "To enable support for the PHPCR ODM documents",
"doctrine/orm": "To enable support for the ORM entities (^2.5)",
"symfony-cmf/content-bundle": "To optionally use the configured value for 'content_basepath' from the CoreBundle"
"doctrine/orm": "To enable support for the ORM entities (^2.5)"
},
"conflict": {
"doctrine/phpcr-odm": "<1.4"
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/CmfRoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ private function loadPhpcrProvider(array $config, LoaderInterface $loader, Conta
$container->setParameter('cmf_routing.backend_type_phpcr', true);
$container->setParameter('cmf_routing.dynamic.persistence.phpcr.route_basepaths', array_values(array_unique($config['route_basepaths'])));

$container->setParameter('cmf_routing.dynamic.persistence.phpcr.content_basepath', $config['content_basepath']);
$container->setParameter('cmf_routing.dynamic.persistence.phpcr.manager_name', $config['manager_name']);

if (0 === count($locales)) {
Expand Down
1 change: 0 additions & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ private function addDynamicSection(ArrayNodeDefinition $root)
->prototype('scalar')->end()
->defaultValue(['/cms/routes'])
->end() // route_basepaths
->scalarNode('content_basepath')->defaultValue('/cms/content')->end()
->booleanNode('enable_initializer')
->defaultValue(true)
->end()
Expand Down
1 change: 0 additions & 1 deletion src/Resources/config/schema/routing-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@

<xsd:attribute name="enabled" type="xsd:boolean" />
<xsd:attribute name="manager-name" type="xsd:string" />
<xsd:attribute name="content-basepath" type="xsd:string" />
<xsd:attribute name="enable-initializer" type="xsd:boolean" />
</xsd:complexType>

Expand Down
1 change: 0 additions & 1 deletion tests/Resources/Fixtures/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
'/cms/routes',
'/simple',
],
'content_basepath' => '/cms/content',
'enable_initializer' => true,
],
],
Expand Down
1 change: 0 additions & 1 deletion tests/Resources/Fixtures/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

<persistence>
<phpcr
content-basepath="/cms/content"
enable-initializer="true"
>
<route-basepath>/cms/routes</route-basepath>
Expand Down
1 change: 0 additions & 1 deletion tests/Resources/Fixtures/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ cmf_routing:
route_basepaths:
- /cms/routes
- /simple
content_basepath: /cms/content
enable_initializer: true
locales: [en, fr]
auto_locale_pattern: true
Expand Down
1 change: 0 additions & 1 deletion tests/Resources/Fixtures/config/config3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<persistence>
<phpcr
manager-name="default"
content-basepath="/cms/content"
enable-initializer="true"
>
<route-basepath>/cms/routes</route-basepath>
Expand Down
1 change: 0 additions & 1 deletion tests/Unit/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public function testSupportsAllConfigFormats()
'/cms/routes',
'/simple',
],
'content_basepath' => '/cms/content',
'manager_name' => null,
'enable_initializer' => true,
],
Expand Down

0 comments on commit f6b028c

Please sign in to comment.