Skip to content

Commit

Permalink
reverted Merge remote branch 'kriswallsmith/kernel/shorter-bundle-names'
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 4, 2011
1 parent 743592d commit f232b3c
Show file tree
Hide file tree
Showing 65 changed files with 143 additions and 161 deletions.
Expand Up @@ -30,7 +30,7 @@ protected function setUp()

public function testBundleNotation()
{
$input = '@My/Resources/css/main.css';
$input = '@MyBundle/Resources/css/main.css';

$this->kernel->expects($this->once())
->method('locateResource')
Expand All @@ -47,7 +47,7 @@ public function testBundleGlobNotation($input)
{
$this->kernel->expects($this->once())
->method('locateResource')
->with('@My/Resources/css/')
->with('@MyBundle/Resources/css/')
->will($this->returnValue('/path/to/bundle/Resources/css/'));

$this->factory->createAsset($input);
Expand All @@ -56,8 +56,8 @@ public function testBundleGlobNotation($input)
public function getGlobs()
{
return array(
array('@My/Resources/css/*'),
array('@My/Resources/css/*/*.css'),
array('@MyBundle/Resources/css/*'),
array('@MyBundle/Resources/css/*/*.css'),
);
}
}
@@ -1,7 +1,7 @@
<?php $view->extend('::base.html.php') ?>

<?php $view['slots']->start('stylesheets') ?>
<?php foreach($view['assetic']->stylesheets('stylesheet1.css, stylesheet2.css, @Test/Resources/css/bundle.css') as $url): ?>
<?php foreach($view['assetic']->stylesheets('stylesheet1.css, stylesheet2.css, @TestBundle/Resources/css/bundle.css') as $url): ?>
<link href="<?php echo $view->escape($url) ?>" type="text/css" rel="stylesheet" />
<?php endforeach; ?>
<?php $view['slots']->stop() ?>
Expand Down
@@ -1,7 +1,7 @@
{% extends '::base.html.twig' %}

{% block stylesheets %}
{% stylesheets 'stylesheet1.css' 'stylesheet2.css' '@Test/Resources/css/bundle.css' %}
{% stylesheets 'stylesheet1.css' 'stylesheet2.css' '@TestBundle/Resources/css/bundle.css' %}
<link href="{{ asset_url }}" type="text/css" rel="stylesheet" />
{% endstylesheets %}
{% endblock %}
Expand Down
Expand Up @@ -19,4 +19,4 @@ twig:
assetic:
use_controller: true
read_from: "%kernel.root_dir%/web"
bundles: [Test]
bundles: [TestBundle]
Expand Up @@ -24,7 +24,7 @@
</service>

<service id="data_collector.doctrine" class="%doctrine.data_collector.class%" public="false">
<tag name="data_collector" template="Doctrine:Collector:db" id="db" />
<tag name="data_collector" template="DoctrineBundle:Collector:db" id="db" />
<argument type="service" id="doctrine.dbal.logger" />
</service>

Expand Down
@@ -1,4 +1,4 @@
{% extends 'WebProfiler:Profiler:layout.html.twig' %}
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}

{% block toolbar %}
{% set icon %}
Expand All @@ -7,7 +7,7 @@
{% set text %}
<span title="{{ '%0.2f'|format(collector.time * 1000) }} ms">{{ collector.querycount }}</span>
{% endset %}
{% include 'WebProfiler:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endblock %}

{% block menu %}
Expand Down
Expand Up @@ -89,7 +89,7 @@
<argument type="service" id="logger" on-invalid="null" />
</service>
<service id="doctrine.odm.mongodb.data_collector" class="%doctrine.odm.mongodb.data_collector_class%" public="false">
<tag name="data_collector" template="DoctrineMongoDB:Collector:mongodb" id="mongodb" />
<tag name="data_collector" template="DoctrineMongoDBBundle:Collector:mongodb" id="mongodb" />
<argument type="service" id="doctrine.odm.mongodb.logger" />
</service>

Expand Down
@@ -1,4 +1,4 @@
{% extends 'WebProfiler:Profiler:layout.html.twig' %}
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}

{% block toolbar %}
{% set icon %}
Expand All @@ -7,7 +7,7 @@
{% set text %}
<span>{{ collector.querycount }}</span>
{% endset %}
{% include 'WebProfiler:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endblock %}

{% block menu %}
Expand Down
Expand Up @@ -41,7 +41,7 @@ public function generateUrl($route, array $parameters = array(), $absolute = fal
/**
* Forwards the request to another controller.
*
* @param string $controller The controller name (a string like Blog:Post:index)
* @param string $controller The controller name (a string like BlogBundle:Post:index)
* @param array $path An array of path parameters
* @param array $query An array of query parameters
*
Expand Down
Expand Up @@ -16,7 +16,7 @@

/**
* ControllerNameParser converts controller from the short notation a:b:c
* (Blog:Post:index) to a fully-qualified class::method string
* (BlogBundle:Post:index) to a fully-qualified class::method string
* (Bundle\BlogBundle\Controller\PostController::indexAction).
*
* @author Fabien Potencier <fabien@symfony.com>
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
Expand Up @@ -47,7 +47,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
/**
* Forwards the request to another controller.
*
* @param string $controller The controller name (a string like Blog:Post:index)
* @param string $controller The controller name (a string like BlogBundle:Post:index)
* @param array $attributes An array of request attributes
* @param array $query An array of request query parameters
*
Expand Down Expand Up @@ -76,7 +76,7 @@ public function forward($controller, array $attributes = array(), array $query =
* * standalone: whether to generate an esi:include tag or not when ESI is supported
* * comment: a comment to add when returning an esi:include tag
*
* @param string $controller A controller name to execute (a string like Blog:Post:index), or a relative URI
* @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
* @param array $options An array of options
*
* @return string The Response content
Expand Down Expand Up @@ -153,7 +153,7 @@ public function render($controller, array $options = array())
*
* This method uses the "_internal" route, which should be available.
*
* @param string $controller A controller name to execute (a string like Blog:Post:index), or a relative URI
* @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
* @param array $attributes An array of request attributes
* @param array $query An array of request query parameters
*
Expand Down
Expand Up @@ -16,38 +16,38 @@

<services>
<service id="data_collector.config" class="%data_collector.config.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:config" id="config" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:config" id="config" priority="255" />
<argument type="service" id="kernel" />
</service>

<service id="data_collector.request" class="%data_collector.request.class%" public="false">
<tag name="kernel.listener" event="onCoreController" />
<tag name="data_collector" template="WebProfiler:Collector:request" id="request" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:request" id="request" priority="255" />
</service>

<service id="data_collector.exception" class="%data_collector.exception.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:exception" id="exception" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:exception" id="exception" priority="255" />
</service>

<service id="data_collector.events" class="%data_collector.events.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:events" id="events" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:events" id="events" priority="255" />
<call method="setEventDispatcher">
<argument type="service" id="event_dispatcher" />
</call>
</service>

<service id="data_collector.logger" class="%data_collector.logger.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:logger" id="logger" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:logger" id="logger" priority="255" />
<argument type="service" id="logger" on-invalid="ignore" />
</service>

<service id="data_collector.timer" class="%data_collector.timer.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:timer" id="timer" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:timer" id="timer" priority="255" />
<argument type="service" id="kernel" />
</service>

<service id="data_collector.memory" class="%data_collector.memory.class%" public="false">
<tag name="data_collector" template="WebProfiler:Collector:memory" id="memory" priority="255" />
<tag name="data_collector" template="WebProfilerBundle:Collector:memory" id="memory" priority="255" />
</service>
</services>
</container>
Expand Up @@ -5,6 +5,6 @@
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">

<route id="_internal" pattern="/{controller}/{path}.{_format}">
<default key="_controller">Framework:Internal:index</default>
<default key="_controller">FrameworkBundle:Internal:index</default>
</route>
</routes>
@@ -1 +1 @@
{% include 'Framework:Exception:error.xml.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:error.xml.twig' with { 'exception': exception } %}
@@ -1 +1 @@
{% include 'Framework:Exception:error.xml.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:error.xml.twig' with { 'exception': exception } %}
@@ -1 +1 @@
{% include 'Framework:Exception:exception.xml.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:exception.xml.twig' with { 'exception': exception } %}
@@ -1,3 +1,3 @@
/*
{% include 'Framework:Exception:exception.txt.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:exception.txt.twig' with { 'exception': exception } %}
*/
Expand Up @@ -41,7 +41,7 @@
</div>

{% for position, e in exception.toarray %}
{% include 'Framework:Exception:traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %}
{% include 'FrameworkBundle:Exception:traces.html.twig' with { 'exception': e, 'position': position, 'count': previous_count } only %}
{% endfor %}

{% if logger %}
Expand All @@ -68,7 +68,7 @@
</div>

<div id="logs">
{% include 'Framework:Exception:logs.html.twig' with { 'logs': logger.logs } only %}
{% include 'FrameworkBundle:Exception:logs.html.twig' with { 'logs': logger.logs } only %}
</div>

</div>
Expand Down
@@ -1,3 +1,3 @@
/*
{% include 'Framework:Exception:exception.txt.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:exception.txt.twig' with { 'exception': exception } %}
*/
@@ -1 +1 @@
{% include 'Framework:Exception:exception.xml.twig' with { 'exception': exception } %}
{% include 'FrameworkBundle:Exception:exception.xml.twig' with { 'exception': exception } %}
Expand Up @@ -2,6 +2,6 @@
[message] {{ exception.message }}
{% for i, e in exception.toarray %}
[{{ i + 1 }}] {{ e.class }}: {{ e.message }}
{% include 'Framework:Exception:traces.txt.twig' with { 'exception': e } only %}
{% include 'FrameworkBundle:Exception:traces.txt.twig' with { 'exception': e } only %}

{% endfor %}
Expand Up @@ -3,7 +3,7 @@
<error code="{{ status_code }}" message="{{ status_text }}">
{% for e in exception.toarray %}
<exception class="{{ e.class }}" message="{{ e.message }}">
{% include 'Framework:Exception:traces.xml.twig' with { 'exception': e } only %}
{% include 'FrameworkBundle:Exception:traces.xml.twig' with { 'exception': e } only %}
</exception>
{% endfor %}
</error>
@@ -1,5 +1,5 @@
{% extends 'Framework:Exception:layout.html.twig' %}
{% extends 'FrameworkBundle:Exception:layout.html.twig' %}

{% block body %}
{% include 'Framework:Exception:exception.html.twig' %}
{% include 'FrameworkBundle:Exception:exception.html.twig' %}
{% endblock %}
Expand Up @@ -18,7 +18,7 @@
<ol class="traces list_exception" id="traces_{{ position }}" style="display: {{ 0 == count ? 'block' : 'none' }}">
{% for i, trace in exception.trace %}
<li>
{% include 'Framework:Exception:trace.html.twig' with { 'prefix': position, 'i': i, 'trace': trace } only %}
{% include 'FrameworkBundle:Exception:trace.html.twig' with { 'prefix': position, 'i': i, 'trace': trace } only %}
</li>
{% endfor %}
</ol>
Expand Down
@@ -1,6 +1,6 @@
{% if exception.trace|length %}
{% for trace in exception.trace %}
{% include 'Framework:Exception:trace.txt.twig' with { 'trace': trace } only %}
{% include 'FrameworkBundle:Exception:trace.txt.twig' with { 'trace': trace } only %}

{% endfor %}
{% endif %}
@@ -1,7 +1,7 @@
<traces>
{% for trace in exception.trace %}
<trace>
{% include 'Framework:Exception:trace.txt.twig' with { 'trace': trace } only %}
{% include 'FrameworkBundle:Exception:trace.txt.twig' with { 'trace': trace } only %}

</trace>
{% endfor %}
Expand Down
@@ -1,4 +1,4 @@
<?php echo str_replace('{{ widget }}',
$view['form']->render($field, array(), array(), 'Framework:Form:number_field.html.php'),
$view['form']->render($field, array(), array(), 'FrameworkBundle:Form:number_field.html.php'),
$field->getPattern()
) ?>
@@ -1 +1 @@
<?php echo $view['form']->render($field, array(), array(), 'Framework:Form:number_field.html.php') ?> %
<?php echo $view['form']->render($field, array(), array(), 'FrameworkBundle:Form:number_field.html.php') ?> %
Expand Up @@ -36,7 +36,7 @@ public function __construct(HttpKernel $kernel)
/**
* Returns the Response content for a given controller or URI.
*
* @param string $controller A controller name to execute (a string like Blog:Post:index), or a relative URI
* @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
* @param array $attributes An array of request attributes
* @param array $options An array of options
*
Expand Down
Expand Up @@ -115,7 +115,7 @@ public function render(/*FieldInterface */$field, array $attributes = array(), a
public function row(/*FieldInterface*/ $field, $template = null)
{
if (null === $template) {
$template = 'Framework:Form:field_row.html.php';
$template = 'FrameworkBundle:Form:field_row.html.php';
}

return $this->engine->render($template, array(
Expand All @@ -126,7 +126,7 @@ public function row(/*FieldInterface*/ $field, $template = null)
public function label(/*FieldInterface */$field, $label = false, array $parameters = array(), $template = null)
{
if (null === $template) {
$template = 'Framework:Form:label.html.php';
$template = 'FrameworkBundle:Form:label.html.php';
}

return $this->engine->render($template, array(
Expand All @@ -139,7 +139,7 @@ public function label(/*FieldInterface */$field, $label = false, array $paramete
public function errors(/*FieldInterface */$field, array $parameters = array(), $template = null)
{
if (null === $template) {
$template = 'Framework:Form:errors.html.php';
$template = 'FrameworkBundle:Form:errors.html.php';
}

return $this->engine->render($template, array(
Expand All @@ -151,7 +151,7 @@ public function errors(/*FieldInterface */$field, array $parameters = array(), $
public function hidden(/*FormInterface */$form, array $parameters = array(), $template = null)
{
if (null === $template) {
$template = 'Framework:Form:hidden.html.php';
$template = 'FrameworkBundle:Form:hidden.html.php';
}

return $this->engine->render($template, array(
Expand Down Expand Up @@ -186,7 +186,7 @@ protected function lookupTemplate(/*FieldInterface */$field)
} while (null === $template && false !== $currentFqClassName);

if (null === $template && $field instanceof FormInterface) {
$template = 'Framework:Form:form.html.php';
$template = 'FrameworkBundle:Form:form.html.php';
}

self::$cache[$fqClassName] = $template;
Expand Down
Expand Up @@ -25,10 +25,10 @@ public function testParse()
{
$parser = $this->createParser();

$this->assertEquals('TestBundle\FooBundle\Controller\DefaultController::indexAction', $parser->parse('Foo:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\FooBundle\Controller\Sub\DefaultController::indexAction', $parser->parse('Foo:Sub\Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\Fabpot\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioFoo:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\Sensio\Cms\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioCmsFoo:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\FooBundle\Controller\DefaultController::indexAction', $parser->parse('FooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\FooBundle\Controller\Sub\DefaultController::indexAction', $parser->parse('FooBundle:Sub\Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\Fabpot\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioFooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');
$this->assertEquals('TestBundle\Sensio\Cms\FooBundle\Controller\DefaultController::indexAction', $parser->parse('SensioCmsFooBundle:Default:index'), '->parse() converts a short a:b:c notation string to a class::method string');

try {
$parser->parse('foo:');
Expand Down Expand Up @@ -56,8 +56,8 @@ public function testMissingControllers($name)
public function getMissingControllersTest()
{
return array(
array('Foo:Fake:index'), // a normal bundle
array('SensioFoo:Fake:index'), // a bundle with children
array('FooBundle:Fake:index'), // a normal bundle
array('SensioFooBundle:Fake:index'), // a bundle with children
);
}

Expand Down
Expand Up @@ -22,7 +22,7 @@ class ProfilerPassTest extends \PHPUnit_Framework_TestCase
* an exception (both are needed if the template is specified). Thus,
* a fully-valid tag looks something like this:
*
* <tag name="data_collector" template="Your:Collector:templatename" id="your_collector_name" />
* <tag name="data_collector" template="YourBundle:Collector:templatename" id="your_collector_name" />
*/
public function testTemplateNoIdThrowsException()
{
Expand Down
Expand Up @@ -25,6 +25,6 @@ class FabpotFooBundle extends Bundle
*/
public function getParent()
{
return 'SensioFoo';
return 'SensioFooBundle';
}
}

0 comments on commit f232b3c

Please sign in to comment.