From fd4381030534e499afdd5ad2bc8822c7291a3c3c Mon Sep 17 00:00:00 2001 From: mwsaz Date: Tue, 25 Jan 2011 23:43:19 +0100 Subject: [PATCH 1/2] [DoctrineBundle] added missing configuration keys --- .../DoctrineBundle/DependencyInjection/DoctrineExtension.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php index b401a71a0efa..217d564dcbc1 100755 --- a/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php +++ b/src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php @@ -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', From 5d212ce35cd2cb66de458446cf121cddb18b58fb Mon Sep 17 00:00:00 2001 From: mwsaz Date: Wed, 26 Jan 2011 00:10:36 +0100 Subject: [PATCH 2/2] [Routing] added '-' as a default separator --- .../Routing/Matcher/Dumper/ApacheMatcherDumper.php | 2 +- src/Symfony/Component/Routing/Route.php | 2 +- .../Tests/Component/Routing/CompiledRouteTest.php | 2 +- .../Routing/Fixtures/dumper/url_matcher1.apache | 4 ++-- .../Routing/Fixtures/dumper/url_matcher1.php | 2 +- .../Tests/Component/Routing/RouteCompilerTest.php | 12 ++++++------ tests/Symfony/Tests/Component/Routing/RouteTest.php | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php index 6dac07ec4a2e..66e32c366fb3 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php @@ -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"; } } diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index f7387b5fff06..c87364dd7078 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -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); diff --git a/tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php b/tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php index ad189624c35e..21c0d1831716 100644 --- a/tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php +++ b/tests/Symfony/Tests/Component/Routing/CompiledRouteTest.php @@ -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'); diff --git a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.apache b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.apache index e9c70c03c33f..1183cbc66935 100644 --- a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.apache +++ b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.apache @@ -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] \ No newline at end of file +RewriteCond %{PATH_INFO} ^/bar/([^/\.\-]+?)$ +RewriteRule .* app.php [QSA,L,E=_ROUTING__route:bar,E=_ROUTING_foo:%1] diff --git a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php index 303fbdfb09b3..605ea31b634d 100644 --- a/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php +++ b/tests/Symfony/Tests/Component/Routing/Fixtures/dumper/url_matcher1.php @@ -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[^/\.]+?)$#x', $url, $matches)) { + if (isset($this->context['method']) && preg_match('#^(GET|head)$#xi', $this->context['method']) && 0 === strpos($url, '/bar') && preg_match('#^/bar/(?P[^/\.\-]+?)$#x', $url, $matches)) { return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'bar')); } diff --git a/tests/Symfony/Tests/Component/Routing/RouteCompilerTest.php b/tests/Symfony/Tests/Component/Routing/RouteCompilerTest.php index 9421e469d5bd..231f3593c37b 100644 --- a/tests/Symfony/Tests/Component/Routing/RouteCompilerTest.php +++ b/tests/Symfony/Tests/Component/Routing/RouteCompilerTest.php @@ -45,7 +45,7 @@ public function provideCompileData() array( 'Route with a variable', array('/foo/{bar}'), - '/foo', '#^/foo/(?P[^/\.]+?)$#x', array('bar' => '{bar}'), array( + '/foo', '#^/foo/(?P[^/\.\-]+?)$#x', array('bar' => '{bar}'), array( array('variable', '/', '{bar}', 'bar'), array('text', '/', 'foo', null), )), @@ -53,7 +53,7 @@ public function provideCompileData() array( 'Route with a variable that has a default value', array('/foo/{bar}', array('bar' => 'bar')), - '/foo', '#^/foo(?:/(?P[^/\.]+?))?$#x', array('bar' => '{bar}'), array( + '/foo', '#^/foo(?:/(?P[^/\.\-]+?))?$#x', array('bar' => '{bar}'), array( array('variable', '/', '{bar}', 'bar'), array('text', '/', 'foo', null), )), @@ -61,7 +61,7 @@ public function provideCompileData() array( 'Route with several variables', array('/foo/{bar}/{foobar}'), - '/foo', '#^/foo/(?P[^/\.]+?)/(?P[^/\.]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( + '/foo', '#^/foo/(?P[^/\.\-]+?)/(?P[^/\.\-]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( array('variable', '/', '{foobar}', 'foobar'), array('variable', '/', '{bar}', 'bar'), array('text', '/', 'foo', null), @@ -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[^/\.]+?) (?:/(?P[^/\.]+?) )?)?$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( + '/foo', '#^/foo(?:/(?P[^/\.\-]+?) (?:/(?P[^/\.\-]+?) )?)?$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( array('variable', '/', '{foobar}', 'foobar'), array('variable', '/', '{bar}', 'bar'), array('text', '/', 'foo', null), @@ -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[^/\.]+?)/(?P[^/\.]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( + '/foo', '#^/foo/(?P[^/\.\-]+?)/(?P[^/\.\-]+?)$#x', array('bar' => '{bar}', 'foobar' => '{foobar}'), array( array('variable', '/', '{foobar}', 'foobar'), array('variable', '/', '{bar}', 'bar'), array('text', '/', 'foo', null), @@ -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[^/\.]+?)$#x', array('foo' => '=foo'), array( + '', '#^/foo/(?P[^/\.\-]+?)$#x', array('foo' => '=foo'), array( array('label', '/', '=foo', 'foo'), )), ); diff --git a/tests/Symfony/Tests/Component/Routing/RouteTest.php b/tests/Symfony/Tests/Component/Routing/RouteTest.php index b484dd544da8..6f2c38d207bb 100644 --- a/tests/Symfony/Tests/Component/Routing/RouteTest.php +++ b/tests/Symfony/Tests/Component/Routing/RouteTest.php @@ -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'); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy