Merge branch '4.0'
* 4.0: [HttpKernel] Better handling of legacy cache modify definitions only if the do exist [DI] Prevent a ReflectionException during cache:clear when the parent class doesn't exist [FrameworkBundle] Make MicroKernelTraitTest green don't override existing verbosity env var [HttpKernel] Read $_ENV when checking SHELL_VERBOSITY Remove unreachable code bumped Symfony version to 4.0.0 Automatically enable the CSRF protection if CSRF manager exists updated VERSION for 4.0.0-RC2 updated CHANGELOG for 4.0.0-RC2 bumped Symfony version to 3.4.0 adding checks for the expression language updated VERSION for 3.4.0-RC2 updated CHANGELOG for 3.4.0-RC2
This commit is contained in:
commit
1cada24000
@ -7,6 +7,22 @@ in 4.0 minor versions.
|
|||||||
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
|
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
|
||||||
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
|
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v4.0.0...v4.0.1
|
||||||
|
|
||||||
|
* 4.0.0-RC2 (2017-11-24)
|
||||||
|
|
||||||
|
* bug #25146 [DI] Dont resolve envs in service ids (nicolas-grekas)
|
||||||
|
* bug #25113 [Routing] Fix "config-file-relative" annotation loader resources (nicolas-grekas, sroze)
|
||||||
|
* bug #25065 [FrameworkBundle] Update translation commands to work with default paths (yceruto)
|
||||||
|
* bug #25109 Make debug:container search command case-insensitive (jzawadzki)
|
||||||
|
* bug #25121 [FrameworkBundle] Fix AssetsInstallCommand (nicolas-grekas)
|
||||||
|
* bug #25102 [Form] Fixed ContextErrorException in FileType (chihiro-adachi)
|
||||||
|
* bug #25130 [DI] Fix handling of inlined definitions by ContainerBuilder (nicolas-grekas)
|
||||||
|
* bug #25119 [DI] Fix infinite loop when analyzing references (nicolas-grekas)
|
||||||
|
* bug #25094 [FrameworkBundle][DX] Display a nice error message if an enabled component is missing (derrabus)
|
||||||
|
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
|
||||||
|
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
|
||||||
|
* bug #25100 [SecurityBundle] providerIds is undefined error when firewall provider is not specified (karser)
|
||||||
|
* bug #25097 [Bridge\PhpUnit] Turn "preserveGlobalState" to false by default, revert "Blacklist" removal (nicolas-grekas)
|
||||||
|
|
||||||
* 4.0.0-RC1 (2017-11-21)
|
* 4.0.0-RC1 (2017-11-21)
|
||||||
|
|
||||||
* bug #25077 [Bridge/Twig] Let getFlashes starts the session (MatTheCat)
|
* bug #25077 [Bridge/Twig] Let getFlashes starts the session (MatTheCat)
|
||||||
|
@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
|
|||||||
use Symfony\Component\Form\Form;
|
use Symfony\Component\Form\Form;
|
||||||
use Symfony\Component\Lock\Lock;
|
use Symfony\Component\Lock\Lock;
|
||||||
use Symfony\Component\Lock\Store\SemaphoreStore;
|
use Symfony\Component\Lock\Store\SemaphoreStore;
|
||||||
|
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
|
||||||
use Symfony\Component\Serializer\Serializer;
|
use Symfony\Component\Serializer\Serializer;
|
||||||
use Symfony\Component\Translation\Translator;
|
use Symfony\Component\Translation\Translator;
|
||||||
use Symfony\Component\Validator\Validation;
|
use Symfony\Component\Validator\Validation;
|
||||||
@ -109,7 +110,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
$rootNode
|
$rootNode
|
||||||
->children()
|
->children()
|
||||||
->arrayNode('csrf_protection')
|
->arrayNode('csrf_protection')
|
||||||
->canBeEnabled()
|
->{!class_exists(FullStack::class) && class_exists(CsrfTokenManagerInterface::class) ? 'canBeDisabled' : 'canBeEnabled'}()
|
||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
@ -18,7 +18,7 @@ class MicroKernelTraitTest extends TestCase
|
|||||||
{
|
{
|
||||||
public function test()
|
public function test()
|
||||||
{
|
{
|
||||||
$kernel = new ConcreteMicroKernel('test', true);
|
$kernel = new ConcreteMicroKernel('test', false);
|
||||||
$kernel->boot();
|
$kernel->boot();
|
||||||
|
|
||||||
$request = Request::create('/');
|
$request = Request::create('/');
|
||||||
@ -31,7 +31,7 @@ class MicroKernelTraitTest extends TestCase
|
|||||||
|
|
||||||
public function testAsEventSubscriber()
|
public function testAsEventSubscriber()
|
||||||
{
|
{
|
||||||
$kernel = new ConcreteMicroKernel('test', true);
|
$kernel = new ConcreteMicroKernel('test', false);
|
||||||
$kernel->boot();
|
$kernel->boot();
|
||||||
|
|
||||||
$request = Request::create('/danger');
|
$request = Request::create('/danger');
|
||||||
|
@ -74,9 +74,6 @@ class RegisterServiceSubscribersPass extends AbstractRecursivePass
|
|||||||
if ($optionalBehavior = '?' === $type[0]) {
|
if ($optionalBehavior = '?' === $type[0]) {
|
||||||
$type = substr($type, 1);
|
$type = substr($type, 1);
|
||||||
$optionalBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
|
$optionalBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
|
||||||
} elseif ($optionalBehavior = '!' === $type[0]) {
|
|
||||||
$type = substr($type, 1);
|
|
||||||
$optionalBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
|
|
||||||
}
|
}
|
||||||
if (is_int($key)) {
|
if (is_int($key)) {
|
||||||
$key = $type;
|
$key = $type;
|
||||||
|
@ -375,7 +375,7 @@ EOTXT
|
|||||||
if (isset($lineage[$class])) {
|
if (isset($lineage[$class])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$r = $this->container->getReflectionClass($class)) {
|
if (!$r = $this->container->getReflectionClass($class, false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->container instanceof $class) {
|
if ($this->container instanceof $class) {
|
||||||
|
@ -488,6 +488,10 @@ class XmlFileLoader extends FileLoader
|
|||||||
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
|
$arguments[$key] = new Reference($arg->getAttribute('id'), $invalidBehavior);
|
||||||
break;
|
break;
|
||||||
case 'expression':
|
case 'expression':
|
||||||
|
if (!class_exists(Expression::class)) {
|
||||||
|
throw new \LogicException(sprintf('The type="expression" attribute cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
|
||||||
|
}
|
||||||
|
|
||||||
$arguments[$key] = new Expression($arg->nodeValue);
|
$arguments[$key] = new Expression($arg->nodeValue);
|
||||||
break;
|
break;
|
||||||
case 'collection':
|
case 'collection':
|
||||||
|
@ -727,6 +727,10 @@ class YamlFileLoader extends FileLoader
|
|||||||
$value[$k] = $this->resolveServices($v, $file, $isParameter);
|
$value[$k] = $this->resolveServices($v, $file, $isParameter);
|
||||||
}
|
}
|
||||||
} elseif (is_string($value) && 0 === strpos($value, '@=')) {
|
} elseif (is_string($value) && 0 === strpos($value, '@=')) {
|
||||||
|
if (!class_exists(Expression::class)) {
|
||||||
|
throw new \LogicException(sprintf('The "@=" expression syntax cannot be used without the ExpressionLanguage component. Try running "composer require symfony/expression-language".'));
|
||||||
|
}
|
||||||
|
|
||||||
return new Expression(substr($value, 2));
|
return new Expression(substr($value, 2));
|
||||||
} elseif (is_string($value) && 0 === strpos($value, '@')) {
|
} elseif (is_string($value) && 0 === strpos($value, '@')) {
|
||||||
if (0 === strpos($value, '@@')) {
|
if (0 === strpos($value, '@@')) {
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Symfony\Component\DependencyInjection\Tests\Fixtures;
|
||||||
|
|
||||||
|
class ParentNotExists extends \NotExists
|
||||||
|
{
|
||||||
|
}
|
@ -7,11 +7,13 @@ use Symfony\Component\DependencyInjection\Definition;
|
|||||||
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
|
||||||
use Symfony\Component\DependencyInjection\Reference;
|
use Symfony\Component\DependencyInjection\Reference;
|
||||||
use Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath;
|
use Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath;
|
||||||
|
use Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists;
|
||||||
|
|
||||||
$container = new ContainerBuilder();
|
$container = new ContainerBuilder();
|
||||||
|
|
||||||
$container->register(HotPath\C1::class)->addTag('container.hot_path')->setPublic(true);
|
$container->register(HotPath\C1::class)->addTag('container.hot_path')->setPublic(true);
|
||||||
$container->register(HotPath\C2::class)->addArgument(new Reference(HotPath\C3::class))->setPublic(true);
|
$container->register(HotPath\C2::class)->addArgument(new Reference(HotPath\C3::class))->setPublic(true);
|
||||||
$container->register(HotPath\C3::class);
|
$container->register(HotPath\C3::class);
|
||||||
|
$container->register(ParentNotExists::class)->setPublic(true);
|
||||||
|
|
||||||
return $container;
|
return $container;
|
||||||
|
@ -30,6 +30,7 @@ class ProjectServiceContainer extends Container
|
|||||||
|
|
||||||
$this->services = $this->privates = array();
|
$this->services = $this->privates = array();
|
||||||
$this->methodMap = array(
|
$this->methodMap = array(
|
||||||
|
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\ParentNotExists' => 'getParentNotExistsService',
|
||||||
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C1' => 'getC1Service',
|
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C1' => 'getC1Service',
|
||||||
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2' => 'getC2Service',
|
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2' => 'getC2Service',
|
||||||
);
|
);
|
||||||
@ -67,6 +68,16 @@ class ProjectServiceContainer extends Container
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists' shared service.
|
||||||
|
*
|
||||||
|
* @return \Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists
|
||||||
|
*/
|
||||||
|
protected function getParentNotExistsService()
|
||||||
|
{
|
||||||
|
return $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\ParentNotExists();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C1' shared service.
|
* Gets the public 'Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C1' shared service.
|
||||||
*
|
*
|
||||||
|
@ -112,7 +112,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($this->debug && !isset($_SERVER['SHELL_VERBOSITY'])) {
|
if ($this->debug && !isset($_ENV['SHELL_VERBOSITY']) && !isset($_SERVER['SHELL_VERBOSITY'])) {
|
||||||
putenv('SHELL_VERBOSITY=3');
|
putenv('SHELL_VERBOSITY=3');
|
||||||
$_ENV['SHELL_VERBOSITY'] = 3;
|
$_ENV['SHELL_VERBOSITY'] = 3;
|
||||||
$_SERVER['SHELL_VERBOSITY'] = 3;
|
$_SERVER['SHELL_VERBOSITY'] = 3;
|
||||||
@ -451,8 +451,11 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
$class = $this->getContainerClass();
|
$class = $this->getContainerClass();
|
||||||
$cacheDir = $this->warmupDir ?: $this->getCacheDir();
|
$cacheDir = $this->warmupDir ?: $this->getCacheDir();
|
||||||
$cache = new ConfigCache($cacheDir.'/'.$class.'.php', $this->debug);
|
$cache = new ConfigCache($cacheDir.'/'.$class.'.php', $this->debug);
|
||||||
$fresh = true;
|
if ($fresh = $cache->isFresh()) {
|
||||||
if (!$cache->isFresh()) {
|
$this->container = require $cache->getPath();
|
||||||
|
$fresh = \is_object($this->container);
|
||||||
|
}
|
||||||
|
if (!$fresh) {
|
||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
$collectedLogs = array();
|
$collectedLogs = array();
|
||||||
$previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
|
$previousHandler = set_error_handler(function ($type, $message, $file, $line) use (&$collectedLogs, &$previousHandler) {
|
||||||
@ -502,11 +505,9 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
$oldContainer = file_exists($cache->getPath()) && is_object($oldContainer = @include $cache->getPath()) ? new \ReflectionClass($oldContainer) : false;
|
$oldContainer = file_exists($cache->getPath()) && is_object($oldContainer = @include $cache->getPath()) ? new \ReflectionClass($oldContainer) : false;
|
||||||
|
|
||||||
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
|
$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
|
||||||
|
$this->container = require $cache->getPath();
|
||||||
$fresh = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->container = require $cache->getPath();
|
|
||||||
$this->container->set('kernel', $this);
|
$this->container->set('kernel', $this);
|
||||||
|
|
||||||
if ($fresh) {
|
if ($fresh) {
|
||||||
|
@ -42,8 +42,8 @@ class Logger extends AbstractLogger
|
|||||||
if (null === $minLevel) {
|
if (null === $minLevel) {
|
||||||
$minLevel = LogLevel::WARNING;
|
$minLevel = LogLevel::WARNING;
|
||||||
|
|
||||||
if (isset($_SERVER['SHELL_VERBOSITY'])) {
|
if (isset($_ENV['SHELL_VERBOSITY']) || isset($_SERVER['SHELL_VERBOSITY'])) {
|
||||||
switch ((int) $_SERVER['SHELL_VERBOSITY']) {
|
switch ((int) (isset($_ENV['SHELL_VERBOSITY']) ? $_ENV['SHELL_VERBOSITY'] : $_SERVER['SHELL_VERBOSITY'])) {
|
||||||
case -1: $minLevel = LogLevel::ERROR; break;
|
case -1: $minLevel = LogLevel::ERROR; break;
|
||||||
case 1: $minLevel = LogLevel::NOTICE; break;
|
case 1: $minLevel = LogLevel::NOTICE; break;
|
||||||
case 2: $minLevel = LogLevel::INFO; break;
|
case 2: $minLevel = LogLevel::INFO; break;
|
||||||
|
@ -64,8 +64,15 @@ class TranslatorPass implements CompilerPassInterface
|
|||||||
->replaceArgument(3, $loaders)
|
->replaceArgument(3, $loaders)
|
||||||
;
|
;
|
||||||
|
|
||||||
if ($container->hasParameter('twig.default_path')) {
|
if (!$container->hasParameter('twig.default_path')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($container->hasDefinition($this->debugCommandServiceId)) {
|
||||||
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
|
$container->getDefinition($this->debugCommandServiceId)->replaceArgument(4, $container->getParameter('twig.default_path'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($container->hasDefinition($this->updateCommandServiceId)) {
|
||||||
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
|
$container->getDefinition($this->updateCommandServiceId)->replaceArgument(5, $container->getParameter('twig.default_path'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user