8000 Merge branch '4.3' into 4.4 · symfony/symfony@c50d0b6 · GitHub
[go: up one dir, main page]

Skip to content

Commit c50d0b6

Browse files
committed
Merge branch '4.3' into 4.4
* 4.3: [HttpKernel] fix wrong removal of the just generated container dir bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel) [Routing] fix route loading with wildcard, but dir or file is empty
2 parents d91b87f + 5ce78cc commit c50d0b6

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container
807807
$fs->dumpFile($dir.$file, $code);
808808
@chmod($dir.$file, 0666 & ~umask());
809809
}
810-
$legacyFile = \dirname($dir.$file).'.legacy';
810+
$legacyFile = \dirname($dir.key($content)).'.legacy';
811811
if (file_exists($legacyFile)) {
812812
@unlink($legacyFile);
813813
}

src/Symfony/Component/Routing/Loader/Configurator/RoutingConfigurator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function __construct(RouteCollection $collection, PhpFileLoader $loader,
3636
final public function import($resource, string $type = null, bool $ignoreErrors = false): ImportConfigurator
3737
{
3838
$this->loader->setCurrentDir(\dirname($this->path));
39-
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file);
39+
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file) ?: [];
40+
4041
if (!\is_array($imported)) {
4142
return new ImportConfigurator($this->collection, $imported);
4243
}

src/Symfony/Component/Routing/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, $
166166
$this->setCurrentDir(\dirname($path));
167167

168168
/** @var RouteCollection[] $imported */
169-
$imported = $this->import($resource, ('' !== $type ? $type : null), false, $file);
169+
$imported = $this->import($resource, ('' !== $type ? $type : null), false, $file) ?: [];
170170

171171
if (!\is_array($imported)) {
172172
$imported = [$imported];

src/Symfony/Component/Routing/Loader/YamlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function parseImport(RouteCollection $collection, array $config, $path
185185

186186
$this->setCurrentDir(\dirname($path));
187187

188-
$imported = $this->import($config['resource'], $type, false, $file);
188+
$imported = $this->import($config['resource'], $type, false, $file) ?: [];
189189

190190
if (!\is_array($imported)) {
191191
$imported = [$imported];

src/Symfony/Component/Routing/Tests/Fixtures/controller/empty_wildcard/.gitignore

Whitespace-only changes.

src/Symfony/Component/Routing/Tests/Fixtures/import_with_name_prefix/routing.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ api:
55
resource: ../controller/routing.yml
66
name_prefix: api_
77
prefix: /api
8+
9+
empty_wildcard:
10+
resource: ../controller/empty_wildcard/*
11+
prefix: /empty_wildcard

0 commit comments

Comments
 (0)
0