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
This commit is contained in:
Fabien Potencier 2019-10-20 14:38:12 +02:00
commit c50d0b6d1c
6 changed files with 9 additions and 4 deletions

View File

@ -807,7 +807,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
$fs->dumpFile($dir.$file, $code);
@chmod($dir.$file, 0666 & ~umask());
}
$legacyFile = \dirname($dir.$file).'.legacy';
$legacyFile = \dirname($dir.key($content)).'.legacy';
if (file_exists($legacyFile)) {
@unlink($legacyFile);
}

View File

@ -36,7 +36,8 @@ class RoutingConfigurator
final public function import($resource, string $type = null, bool $ignoreErrors = false): ImportConfigurator
{
$this->loader->setCurrentDir(\dirname($this->path));
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file);
$imported = $this->loader->import($resource, $type, $ignoreErrors, $this->file) ?: [];
if (!\is_array($imported)) {
return new ImportConfigurator($this->collection, $imported);
}

View File

@ -166,7 +166,7 @@ class XmlFileLoader extends FileLoader
$this->setCurrentDir(\dirname($path));
/** @var RouteCollection[] $imported */
$imported = $this->import($resource, ('' !== $type ? $type : null), false, $file);
$imported = $this->import($resource, ('' !== $type ? $type : null), false, $file) ?: [];
if (!\is_array($imported)) {
$imported = [$imported];

View File

@ -185,7 +185,7 @@ class YamlFileLoader extends FileLoader
$this->setCurrentDir(\dirname($path));
$imported = $this->import($config['resource'], $type, false, $file);
$imported = $this->import($config['resource'], $type, false, $file) ?: [];
if (!\is_array($imported)) {
$imported = [$imported];

View File

@ -5,3 +5,7 @@ api:
resource: ../controller/routing.yml
name_prefix: api_
prefix: /api
empty_wildcard:
resource: ../controller/empty_wildcard/*
prefix: /empty_wildcard