Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit b607bce

Browse files
committed
Merge pull request #44 from kea/patch/41-upgrade-to-new-standard
Upgrade to new standard
2 parents b424e6c + 492c465 commit b607bce

File tree

5 files changed

+51
-14
lines changed

5 files changed

+51
-14
lines changed

DependencyInjection/CmfTreeBrowserExtension.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Symfony\Cmf\Bundle\TreeBrowserBundle\DependencyInjection;
44

5-
use Symfony\Component\Config\FileLocator,
6-
Symfony\Component\HttpKernel\DependencyInjection\Extension,
7-
Symfony\Component\DependencyInjection\Reference,
8-
Symfony\Component\DependencyInjection\ContainerInterface,
9-
Symfony\Component\DependencyInjection\ContainerBuilder,
10-
Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
5+
use Symfony\Component\Config\FileLocator;
6+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
7+
use Symfony\Component\DependencyInjection\Reference;
8+
use Symfony\Component\DependencyInjection\ContainerInterface;
9+
use Symfony\Component\DependencyInjection\ContainerBuilder;
10+
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
1111

1212
/**
1313
* @author Lukas Kahwe Smith <[email protected]>
@@ -28,10 +28,12 @@ public function load(array $configs, ContainerBuilder $container)
2828

2929
$bundles = $container->getParameter('kernel.bundles');
3030

31-
if (isset($bundles['DoctrinePHPCRBundle'])) {
32-
$loader->load('phpcr.xml');
33-
$phpcr_tree = $container->getDefinition('cmf_tree_browser.phpcr_tree');
34-
$phpcr_tree->replaceArgument(1, $config['session_name']);
31+
if (isset($bundles['DoctrinePHPCRBundle'])
32+
&& !empty($config['persistence']['phpcr']['enabled'])) {
33+
34+
$loader->load('tree-phpcr.xml');
35+
$phpcrTree = $container->getDefinition('cmf_tree_browser.phpcr_tree');
36+
$phpcrTree->replaceArgument(1, $config['persistence']['phpcr']['session_name']);
3537
}
3638

3739
$loader->load('tree.xml');

DependencyInjection/Configuration.php

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ class Configuration implements ConfigurationInterface
2424
public function getConfigTreeBuilder()
2525
{
2626
$treeBuilder = new TreeBuilder();
27-
$rootNode = $treeBuilder->root('cmf_tree_browser');
28-
29-
$rootNode
27+
$treeBuilder->root('cmf_tree_browser')
3028
->children()
31-
->scalarNode('session_name')->defaultValue('default')->end()
29+
->arrayNode('persistence')
30+
->children()
31+
->arrayNode('phpcr')
32+
->children()
33+
->scalarNode('enabled')->defaultValue(true)->end()
34+
->scalarNode('session_name')->defaultValue('default')->end()
35+
->end()
36+
->end()
37+
->end()
38+
->end()
3239
->end()
3340
;
3441

File renamed without changes.

Resources/meta/LICENSE

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
TreeBrowerBundle
2+
3+
The MIT License
4+
5+
Copyright (c) 2011-2013 Symfony2 CMF
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in
15+
all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
THE SOFTWARE.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cmf_tree_browser:
2+
persistence:
3+
phpcr:
4+
enabled: true
5+
session_name: 'default'

0 commit comments

Comments
 (0)