Merge branch '4.0' into 4.1

* 4.0:
  [TwigBundle][DX] Only add the Twig WebLinkExtension if the WebLink component is enabled
  Add note about changed form processing when using PUT requests
  [SecurityBundle] Dont throw if "security.http_utils" is not found
  [Di] Fix undefined variable found by Php Inspections (EA Ultimate)
  [DI] Cleanup unused service_subscriber.locator tag
  [DI] Resolve env placeholder in logs
  The debug class loader is always loaded by Debug::enable().
  [Intl] Update ICU data to 62.1
This commit is contained in:
Fabien Potencier 2018-06-25 13:12:43 +02:00
commit 8c687c6401
418 changed files with 476 additions and 441 deletions

View File

@ -11,6 +11,7 @@
namespace Symfony\Bridge\Twig;
use Symfony\Bundle\FullStack;
use Twig\Error\SyntaxError;
/**
@ -56,14 +57,21 @@ class UndefinedCallableHandler
'workflow_marked_places' => 'workflow',
);
private static $fullStackEnable = array(
'form' => 'enable "framework.form"',
'security-core' => 'add the "SecurityBundle"',
'security-http' => 'add the "SecurityBundle"',
'web-link' => 'enable "framework.web_link"',
'workflow' => 'enable "framework.workflows"',
);
public static function onUndefinedFilter($name)
{
if (!isset(self::$filterComponents[$name])) {
return false;
}
// Twig will append the source context to the message, so that it will end up being like "[...] Unknown filter "%s" in foo.html.twig on line 123."
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown filter "%s".', self::$filterComponents[$name], $name));
self::onUndefined($name, 'filter', self::$filterComponents[$name]);
}
public static function onUndefinedFunction($name)
@ -72,6 +80,15 @@ class UndefinedCallableHandler
return false;
}
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown function "%s".', self::$functionComponents[$name], $name));
self::onUndefined($name, 'function', self::$functionComponents[$name]);
}
private static function onUndefined($name, $type, $component)
{
if (\class_exists(FullStack::class) && isset(self::$fullStackEnable[$component])) {
throw new SyntaxError(sprintf('Did you forget to %s? Unknown %s "%s".', self::$fullStackEnable[$component], $type, $name));
}
throw new SyntaxError(sprintf('Did you forget to run "composer require symfony/%s"? Unknown %s "%s".', $component, $type, $name));
}
}

View File

@ -26,7 +26,7 @@ class AddSessionDomainConstraintPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasParameter('session.storage.options')) {
if (!$container->hasParameter('session.storage.options') || !$container->has('security.http_utils')) {
return;
}
@ -34,7 +34,6 @@ class AddSessionDomainConstraintPass implements CompilerPassInterface
$domainRegexp = empty($sessionOptions['cookie_domain']) ? '%s' : sprintf('(?:%%s|(?:.+\.)?%s)', preg_quote(trim($sessionOptions['cookie_domain'], '.')));
$domainRegexp = (empty($sessionOptions['cookie_secure']) ? 'https?://' : 'https://').$domainRegexp;
// if the service doesn't exist, an exception must be thrown - ignoring would put security at risk
$container->findDefinition('security.http_utils')->addArgument(sprintf('{^%s$}i', $domainRegexp));
}
}

View File

@ -96,19 +96,6 @@ class AddSessionDomainConstraintPassTest extends TestCase
$this->assertTrue($utils->createRedirectResponse($request, 'http://pirate.com/foo')->isRedirect('http://pirate.com/foo'));
}
/**
* @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
* @expectedExceptionMessage You have requested a non-existent service "security.http_utils".
*/
public function testNoHttpUtils()
{
$container = new ContainerBuilder();
$container->setParameter('session.storage.options', array());
$pass = new AddSessionDomainConstraintPass();
$pass->process($container);
}
private function createContainer($sessionStorageOptions)
{
$container = new ContainerBuilder();

View File

@ -82,6 +82,10 @@ class ExtensionPass implements CompilerPassInterface
}
}
if ($container->has('web_link.add_link_header_listener')) {
$container->getDefinition('twig.extension.weblink')->addTag('twig.extension');
}
$twigLoader = $container->getDefinition('twig.loader.native_filesystem');
if ($container->has('templating')) {
$loader = $container->getDefinition('twig.loader.filesystem');

View File

@ -11,7 +11,6 @@
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
use Symfony\Bridge\Twig\Extension\WebLinkExtension;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Resource\FileExistenceResource;
use Symfony\Component\Console\Application;
@ -19,7 +18,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\WebLink\HttpHeaderSerializer;
use Twig\Extension\ExtensionInterface;
use Twig\Extension\RuntimeExtensionInterface;
use Twig\Loader\LoaderInterface;
@ -53,13 +51,6 @@ class TwigExtension extends Extension
$container->removeDefinition('twig.translation.extractor');
}
if (class_exists(HttpHeaderSerializer::class)) {
$definition = $container->register('twig.extension.weblink', WebLinkExtension::class);
$definition->setPublic(false);
$definition->addArgument(new Reference('request_stack'));
$definition->addTag('twig.extension');
}
foreach ($configs as $key => $config) {
if (isset($config['globals'])) {
foreach ($config['globals'] as $name => $value) {

View File

@ -114,6 +114,10 @@
<service id="twig.extension.debug" class="Twig\Extension\DebugExtension" />
<service id="twig.extension.weblink" class="Symfony\Bridge\Twig\Extension\WebLinkExtension">
<argument type="service" id="request_stack" />
</service>
<service id="twig.translation.extractor" class="Symfony\Bridge\Twig\Translation\TwigExtractor">
<argument type="service" id="twig" />
<tag name="translation.extractor" alias="twig" />

View File

@ -35,7 +35,12 @@ class ResolveServiceSubscribersPass extends AbstractRecursivePass
}
$serviceLocator = $this->serviceLocator;
$this->serviceLocator = $value->hasTag('container.service_subscriber.locator') ? $value->getTag('container.service_subscriber.locator')[0]['id'] : null;
$this->serviceLocator = null;
if ($value->hasTag('container.service_subscriber.locator')) {
$this->serviceLocator = $value->getTag('container.service_subscriber.locator')[0]['id'];
$value->clearTag('container.service_subscriber.locator');
}
try {
return parent::processValue($value);

View File

@ -1418,7 +1418,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
*/
public function log(CompilerPassInterface $pass, string $message)
{
$this->getCompiler()->log($pass, $message);
$this->getCompiler()->log($pass, $this->resolveEnvPlaceholders($message));
}
/**

View File

@ -496,7 +496,7 @@ EOTXT
// $b = new ServiceB();
// $a = new ServiceA(ServiceB $b);
// $b->setServiceA(ServiceA $a);
if (isset($inlinedDefinition[$definition]) && $this->hasReference($id, array($def->getArguments(), $def->getFactory()))) {
if (isset($inlinedDefinitions[$definition]) && $this->hasReference($id, array($def->getArguments(), $def->getFactory()))) {
throw new ServiceCircularReferenceException($id, array($id));
}

View File

@ -235,7 +235,7 @@ final class Intl
*/
public static function getIcuStubVersion()
{
return '61.1';
return '62.1';
}
/**

View File

@ -17,3 +17,4 @@
59 = http://source.icu-project.org/repos/icu/tags/release-59-1/icu4c/source
60 = http://source.icu-project.org/repos/icu/tags/release-60-2/icu4c/source
61 = http://source.icu-project.org/repos/icu/tags/release-61-1/icu4c/source
62 = http://source.icu-project.org/repos/icu/tags/release-62-1/icu4c/source

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.15",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.41",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.38.69",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.27",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.38.39",
"Version": "2.1.41.97",
"Names": {
"VEF": [
"Bs.",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.40",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.27",
"Version": "2.1.41.58",
"Currencies": [
"ADP",
"AED",
@ -663,6 +663,12 @@
0,
0
],
"VEF": [
2,
0,
0,
0
],
"VND": [
0,
0,

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",
@ -271,7 +271,7 @@
],
"CNY": [
"CN¥",
"Chinese Yuan"
"Chinese yuan"
],
"COP": [
"COP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.15",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.27",
"Version": "2.1.41.58",
"Names": {
"AUD": [
"A$",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.37",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.37",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.20",
"Version": "2.1.41.97",
"Names": {
"ADP": [
"ADP",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

View File

@ -1,5 +1,5 @@
{
"Version": "2.1.39.11",
"Version": "2.1.41.97",
"Names": {
"AED": [
"AED",

Some files were not shown because too many files have changed in this diff Show More