Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ public function ormLoad(array $configs, ContainerBuilder $container)
protected function mergeOrmConfig(array $configs, $container)
{
$supportedEntityManagerOptions = array(
'proxy_dir' => 'proxy_dir',
'proxy_namespace' => 'proxy_namespace',
'auto_generate_proxy_classes' => 'auto_generate_proxy_classes',
'metadata_cache_driver' => 'metadata_cache_driver',
'query_cache_driver' => 'query_cache_driver',
'result_cache_driver' => 'result_cache_driver',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@ public function dump(array $options = array())
$regexes[] = sprintf("%sRewriteCond %%{PATH_INFO} %s\nRewriteRule .* %s [QSA,L,%s]", $conditions, $regex, $options['script_name'], $variables);
}

return implode("\n\n", $regexes);
return implode("\n\n", $regexes)."\n";
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function getOptions()
public function setOptions(array $options)
{
$this->options = array_merge(array(
'segment_separators' => array('/', '.'),
'segment_separators' => array('/', '.', '-'),
'text_regex' => '.+?',
'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
), $options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testgetPatterngetDefaultsgetOptionsgetRequirements()
$this->assertEquals(array('foo' => 'bar'), $compiled->getDefaults(), '->getDefaults() returns the route defaults');
$this->assertEquals(array('foo' => '\d+'), $compiled->getRequirements(), '->getRequirements() returns the route requirements');
$this->assertEquals(array_merge(array(
'segment_separators' => array('/', '.'),
'segment_separators' => array('/', '.', '-'),
'text_regex' => '.+?',
'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
), array('foo' => 'bar')), $compiled->getOptions(), '->getOptions() returns the route options');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ RewriteCond %{PATH_INFO} ^/foo/(baz|symfony)$
RewriteRule .* app.php [QSA,L,E=_ROUTING__route:foo,E=_ROUTING_bar:%1,E=_ROUTING_def:test]

RewriteCond %{REQUEST_METHOD} ^(GET|head) [NC]
RewriteCond %{PATH_INFO} ^/bar/([^/\.]+?)$
RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1]
RewriteCond %{PATH_INFO} ^/bar/([^/\.\-]+?)$
RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1]
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function match($url)
return array_merge($this->mergeDefaults($matches, array ( 'def' => 'test',)), array('_route' => 'foo'));
}

if (isset($this->context['method']) && preg_match('#^(GET|head)$#xi', $this->context['method']) && 0 === strpos($url, '/bar') && preg_match('#^/bar/(?P<foo>[^/\.]+?)$#x', $url, $matches)) {
if (isset($this->context['method']) && preg_match('#^(GET|head)$#xi', $this->context['method']) && 0 === strpos($url, '/bar') && preg_match('#^/bar/(?P<foo>[^/\.\-]+?)$#x', $url, $matches)) {
return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'bar'));
}

Expand Down
12 changes: 6 additions & 6 deletions tests/Symfony/Tests/Component/Routing/RouteCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,23 @@ public function provideCompileData()
array(
'Route with a variable',
array('/foo/{bar}'),
'/foo', '#^/foo/(?P<bar>[^/\.]+?)$#x', array('bar' => '{bar}'), array(
'/foo', '#^/foo/(?P<bar>[^/\.\-]+?)$#x', array('bar' => '{bar}'), array(
array('variable', '/', '{bar}', 'bar'),
array('text', '/', 'foo', null),
)),

array(
'Route with a variable that has a default value',
array('/foo/{bar}', array('bar' => 'bar')),
'/foo', '#^/foo(?:/(?P<bar>[^/\.]+?))?$#x', array('bar' => '{bar}'), array(
'/foo', '#^/foo(?:/(?P<bar>[^/\.\-]+?))?$#x', array('bar' => '{bar}'), array(
array('variable', '/', '{bar}', 'bar'),
array('text', '/', 'foo', null),
)),

array(
'Route with several variables',
array('/foo/{bar}/{foobar}'),
'/foo', '#^/foo/(?P<bar>[^/\.]+?)/(?P<foobar>[^/\.]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
'/foo', '#^/foo/(?P<bar>[^/\.\-]+?)/(?P<foobar>[^/\.\-]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
array('variable', '/', '{foobar}', 'foobar'),
array('variable', '/', '{bar}', 'bar'),
array('text', '/', 'foo', null),
Expand All @@ -70,7 +70,7 @@ public function provideCompileData()
array(
'Route with several variables that have default values',
array('/foo/{bar}/{foobar}', array('bar' => 'bar', 'foobar' => 'foobar')),
'/foo', '#^/foo(?:/(?P<bar>[^/\.]+?) (?:/(?P<foobar>[^/\.]+?) )?)?$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
'/foo', '#^/foo(?:/(?P<bar>[^/\.\-]+?) (?:/(?P<foobar>[^/\.\-]+?) )?)?$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
array('variable', '/', '{foobar}', 'foobar'),
array('variable', '/', '{bar}', 'bar'),
array('text', '/', 'foo', null),
Expand All @@ -79,7 +79,7 @@ public function provideCompileData()
array(
'Route with several variables but some of them have no default values',
array('/foo/{bar}/{foobar}', array('bar' => 'bar')),
'/foo', '#^/foo/(?P<bar>[^/\.]+?)/(?P<foobar>[^/\.]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
'/foo', '#^/foo/(?P<bar>[^/\.\-]+?)/(?P<foobar>[^/\.\-]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array(
array('variable', '/', '{foobar}', 'foobar'),
array('variable', '/', '{bar}', 'bar'),
array('text', '/', 'foo', null),
Expand All @@ -88,7 +88,7 @@ public function provideCompileData()
array(
'Route with a custom token',
array('/=foo', array(), array(), array('compiler_class' => 'Symfony\\Tests\\Component\\Routing\\RouteCompiler')),
'', '#^/foo/(?P<foo>[^/\.]+?)$#x', array('foo' => '=foo'), array(
'', '#^/foo/(?P<foo>[^/\.\-]+?)$#x', array('foo' => '=foo'), array(
array('label', '/', '=foo', 'foo'),
)),
);
Expand Down
2 changes: 1 addition & 1 deletion tests/Symfony/Tests/Component/Routing/RouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testOptions()
$route = new Route('/{foo}');
$route->setOptions(array('foo' => 'bar'));
$this->assertEquals(array_merge(array(
'segment_separators' => array('/', '.'),
'segment_separators' => array('/', '.', '-'),
'text_regex' => '.+?',
'compiler_class' => 'Symfony\\Component\\Routing\\RouteCompiler',
), array('foo' => 'bar')), $route->getOptions(), '->setOptions() sets the options');
Expand Down