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

Commit

Permalink
[WIP] Removed symfony_cmf prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
dantleech committed May 25, 2013
1 parent bc9a0a1 commit 54e059e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
Expand Up @@ -8,7 +8,7 @@

use Symfony\Cmf\Bundle\TreeBrowserBundle\DependencyInjection\Compiler\AddTreesCompilerPass;

class SymfonyCmfTreeBrowserBundle extends Bundle
class CmfTreeBrowserBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
Expand Down
Expand Up @@ -12,7 +12,7 @@
/**
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
class SymfonyCmfTreeBrowserExtension extends Extension
class CmfTreeBrowserExtension extends Extension
{
/**
* Loads the services based on your application configuration.
Expand All @@ -30,7 +30,7 @@ public function load(array $configs, ContainerBuilder $container)

if (isset($bundles['DoctrinePHPCRBundle'])) {
$loader->load('phpcr.xml');
$phpcr_tree = $container->getDefinition('symfony_cmf_tree_browser.phpcr_tree');
$phpcr_tree = $container->getDefinition('cmf_tree_browser.phpcr_tree');
$phpcr_tree->replaceArgument(1, $config['session_name']);
}

Expand Down
10 changes: 5 additions & 5 deletions DependencyInjection/Compiler/AddTreesCompilerPass.php
Expand Up @@ -18,20 +18,20 @@ class AddTreesCompilerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
$trees = $container->findTaggedServiceIds('symfony_cmf.tree');
$trees = $container->findTaggedServiceIds('cmf.tree');
$controllers = array();
foreach ($trees as $treeId => $tag) {
$tree = $container->getDefinition($treeId);
$alias = isset($tag[0]['alias'])
? $tag[0]['alias']
: $treeId;

$controller = new DefinitionDecorator('symfony_cmf_tree_browser.controller_prototype');
$controller = new DefinitionDecorator('cmf_tree_browser.controller_prototype');
$controller->replaceArgument(0, $tree);
$container->setDefinition($alias.'.symfony_cmf_tree_controller', $controller);
$controllers[] = array('id' => $alias.'.symfony_cmf_tree_controller', 'alias' => $alias);
$container->setDefinition($alias.'.cmf_tree_controller', $controller);
$controllers[] = array('id' => $alias.'.cmf_tree_controller', 'alias' => $alias);
}
$container->setParameter('symfony_cmf_tree_browser.tree_controllers', $controllers);
$container->setParameter('cmf_tree_browser.tree_controllers', $controllers);
}

}
2 changes: 1 addition & 1 deletion DependencyInjection/Configuration.php
Expand Up @@ -24,7 +24,7 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('symfony_cmf_tree_browser');
$rootNode = $treeBuilder->root('cmf_tree_browser');

$rootNode
->children()
Expand Down
4 changes: 2 additions & 2 deletions Resources/config/phpcr.xml
Expand Up @@ -6,8 +6,8 @@

<services>

<service id="symfony_cmf_tree_browser.phpcr_tree" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Tree\PHPCRTree">
<tag name="symfony_cmf.tree" alias="phpcr_tree" />
<service id="cmf_tree_browser.phpcr_tree" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Tree\PHPCRTree">
<tag name="cmf.tree" alias="phpcr_tree" />
<argument type="service" id="doctrine_phpcr"/>
<argument />
</service>
Expand Down
6 changes: 3 additions & 3 deletions Resources/config/tree.xml
Expand Up @@ -5,13 +5,13 @@

<services>

<service id="symfony_cmf_tree_browser.controller_prototype" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Controller\TreeBrowserController" abstract="true">
<service id="cmf_tree_browser.controller_prototype" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Controller\TreeBrowserController" abstract="true">
<argument/> <!-- tree implementation -->
</service>

<service id="symfony_cmf_tree_browser.route_loader" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Route\TreeControllerRoutesLoader">
<service id="cmf_tree_browser.route_loader" class="Symfony\Cmf\Bundle\TreeBrowserBundle\Route\TreeControllerRoutesLoader">
<tag name="routing.loader" />
<argument>%symfony_cmf_tree_browser.tree_controllers%</argument>
<argument>%cmf_tree_browser.tree_controllers%</argument>
</service>

</services>
Expand Down
6 changes: 3 additions & 3 deletions Route/TreeControllerRoutesLoader.php
Expand Up @@ -39,10 +39,10 @@ public function load($resource, $type = null)
$requirements = array(
'_method' => $definition['method']
);
$pattern = '_symfony_cmf_tree/'.$controller['alias'].'/'.$definition['pattern'];
$pattern = '_cmf_tree/'.$controller['alias'].'/'.$definition['pattern'];

$route = new Route($pattern, $defaults, $requirements, array('expose' => true));
$collection->add('_symfony_cmf_tree_'.$controller['alias'].'_'.$name, $route);
$collection->add('_cmf_tree_'.$controller['alias'].'_'.$name, $route);
}
}
return $collection;
Expand All @@ -59,7 +59,7 @@ public function load($resource, $type = null)
*/
public function supports($resource, $type = null)
{
if ($type == 'symfony_cmf_tree') {
if ($type == 'cmf_tree') {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/AppKernel.php
Expand Up @@ -32,7 +32,7 @@ public function registerBundles()
new \Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new \Doctrine\Bundle\PHPCRBundle\DoctrinePHPCRBundle(),
new \Symfony\Cmf\Bundle\TreeBrowserBundle\SymfonyCmfTreeBrowserBundle(),
new \Symfony\Cmf\Bundle\TreeBrowserBundle\CmfTreeBrowserBundle(),
);
}

Expand All @@ -43,6 +43,6 @@ public function registerContainerConfiguration(LoaderInterface $loader)

public function getCacheDir()
{
return sys_get_temp_dir().'/SymfonyCmfTreeBrowserBundle';
return sys_get_temp_dir().'/CmfTreeBrowserBundle';
}
}
4 changes: 2 additions & 2 deletions Tests/Functional/PHPCR/PHPCRBrowserTest.php
Expand Up @@ -18,7 +18,7 @@ public function testGetChildrenListFromRoot()

$client = $this->createClient();

$client->request('GET', '/_symfony_cmf_tree/phpcr_tree/children');
$client->request('GET', '/_cmf_tree/phpcr_tree/children');

$this->assertEquals(
$client->getResponse()->getContent(),
Expand All @@ -32,7 +32,7 @@ public function testGetChildrenListFromInnerNode()

$client = $this->createClient();

$crawler = $client->request('GET', '/_symfony_cmf_tree/phpcr_tree/children?root=%2Fcms%2Fcontent');
$crawler = $client->request('GET', '/_cmf_tree/phpcr_tree/children?root=%2Fcms%2Fcontent');

$this->assertEquals(
$client->getResponse()->getContent(),
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/config/routing.yml
Expand Up @@ -2,6 +2,6 @@ symfony_route:
pattern: /symfony_route_test
defaults: { _controller: Test:controller }

symfony_cmf_tree:
cmf_tree:
resource: .
type: 'symfony_cmf_tree'
type: 'cmf_tree'

0 comments on commit 54e059e

Please sign in to comment.