Merge branch '2.7' into 2.8
* 2.7: Mark deprecated Twig functions as deprecated with the Twig feature [appveyor] PHP 5.3.11 for Symfony 2.7 [HttpKernel] Group deprecation notices Conflicts: appveyor.yml
This commit is contained in:
commit
922a534427
@ -22,8 +22,8 @@ init:
|
|||||||
install:
|
install:
|
||||||
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
|
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
|
||||||
- cd c:\php
|
- cd c:\php
|
||||||
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.9-nts-Win32-VC9-x86.zip
|
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.11-nts-Win32-VC9-x86.zip
|
||||||
- IF %PHP%==1 7z x php-5.3.9-nts-Win32-VC9-x86.zip -y > 7z.log
|
- IF %PHP%==1 7z x php-5.3.11-nts-Win32-VC9-x86.zip -y > 7z.log
|
||||||
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip
|
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip
|
||||||
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y > 7z.log
|
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y > 7z.log
|
||||||
- IF %PHP%==1 cd ext
|
- IF %PHP%==1 cd ext
|
||||||
|
@ -14,8 +14,8 @@ namespace Symfony\Bridge\Twig;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
use Symfony\Component\HttpFoundation\Session\Session;
|
use Symfony\Component\HttpFoundation\Session\Session;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
|
use Symfony\Component\Security\Core\SecurityContext;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -42,7 +42,7 @@ class AssetExtension extends \Twig_Extension
|
|||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFunction('asset', array($this, 'getAssetUrl')),
|
new \Twig_SimpleFunction('asset', array($this, 'getAssetUrl')),
|
||||||
new \Twig_SimpleFunction('asset_version', array($this, 'getAssetVersion')),
|
new \Twig_SimpleFunction('asset_version', array($this, 'getAssetVersion')),
|
||||||
new \Twig_SimpleFunction('assets_version', array($this, 'getAssetsVersion')),
|
new \Twig_SimpleFunction('assets_version', array($this, 'getAssetsVersion'), array('deprecated' => true, 'alternative' => 'asset_version')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class FormExtension extends \Twig_Extension
|
|||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
new \Twig_SimpleFunction('form_enctype', null, array('node_class' => 'Symfony\Bridge\Twig\Node\FormEnctypeNode', 'is_safe' => array('html'))),
|
new \Twig_SimpleFunction('form_enctype', null, array('node_class' => 'Symfony\Bridge\Twig\Node\FormEnctypeNode', 'is_safe' => array('html'), 'deprecated' => true, 'alternative' => 'form_start')),
|
||||||
new \Twig_SimpleFunction('form_widget', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
new \Twig_SimpleFunction('form_widget', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
||||||
new \Twig_SimpleFunction('form_errors', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
new \Twig_SimpleFunction('form_errors', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
||||||
new \Twig_SimpleFunction('form_label', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
new \Twig_SimpleFunction('form_label', null, array('node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', 'is_safe' => array('html'))),
|
||||||
|
@ -120,6 +120,10 @@
|
|||||||
{% set stack = log.context.stack|default([]) %}
|
{% set stack = log.context.stack|default([]) %}
|
||||||
{% set id = 'sf-call-stack-' ~ log_index %}
|
{% set id = 'sf-call-stack-' ~ log_index %}
|
||||||
|
|
||||||
|
{% if log.context.errorCount is defined %}
|
||||||
|
({{ log.context.errorCount }}x)
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if stack %}
|
{% if stack %}
|
||||||
<a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;">
|
<a href="#" onclick="Sfjs.toggle('{{ id }}', document.getElementById('{{ id }}-on'), document.getElementById('{{ id }}-off')); return false;">
|
||||||
<img class="toggle" id="{{ id }}-off" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display:none">
|
<img class="toggle" id="{{ id }}-off" alt="-" src="data:image/gif;base64,R0lGODlhEgASAMQSANft94TG57Hb8GS44ez1+mC24IvK6ePx+Wa44dXs92+942e54o3L6W2844/M6dnu+P/+/l614P///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAABIALAAAAAASABIAQAVCoCQBTBOd6Kk4gJhGBCTPxysJb44K0qD/ER/wlxjmisZkMqBEBW5NHrMZmVKvv9hMVsO+hE0EoNAstEYGxG9heIhCADs=" style="display:none">
|
||||||
|
@ -102,7 +102,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
'name' => $argument->getName(),
|
'name' => $argument->getName(),
|
||||||
'is_required' => $argument->isRequired(),
|
'is_required' => $argument->isRequired(),
|
||||||
'is_array' => $argument->isArray(),
|
'is_array' => $argument->isArray(),
|
||||||
'description' => preg_replace('/\s*\R\s*/', ' ', $argument->getDescription()),
|
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()),
|
||||||
'default' => $argument->getDefault(),
|
'default' => $argument->getDefault(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ class JsonDescriptor extends Descriptor
|
|||||||
'accept_value' => $option->acceptValue(),
|
'accept_value' => $option->acceptValue(),
|
||||||
'is_value_required' => $option->isValueRequired(),
|
'is_value_required' => $option->isValueRequired(),
|
||||||
'is_multiple' => $option->isArray(),
|
'is_multiple' => $option->isArray(),
|
||||||
'description' => preg_replace('/\s*\R\s*/', ' ', $option->getDescription()),
|
'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()),
|
||||||
'default' => $option->getDefault(),
|
'default' => $option->getDefault(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
.'* Name: '.($argument->getName() ?: '<none>')."\n"
|
.'* Name: '.($argument->getName() ?: '<none>')."\n"
|
||||||
.'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n"
|
.'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n"
|
||||||
.'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n"
|
.'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n"
|
||||||
.'* Description: '.preg_replace('/\s*\R\s*/', PHP_EOL.' ', $argument->getDescription() ?: '<none>')."\n"
|
.'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $argument->getDescription() ?: '<none>')."\n"
|
||||||
.'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'
|
.'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ class MarkdownDescriptor extends Descriptor
|
|||||||
.'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
|
.'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n"
|
||||||
.'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
|
.'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n"
|
||||||
.'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
|
.'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n"
|
||||||
.'* Description: '.preg_replace('/\s*\R\s*/', PHP_EOL.' ', $option->getDescription() ?: '<none>')."\n"
|
.'* Description: '.preg_replace('/\s*[\r\n]\s*/', "\n ", $option->getDescription() ?: '<none>')."\n"
|
||||||
.'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'
|
.'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ class TextDescriptor extends Descriptor
|
|||||||
$argument->getName(),
|
$argument->getName(),
|
||||||
str_repeat(' ', $spacingWidth),
|
str_repeat(' ', $spacingWidth),
|
||||||
// + 17 = 2 spaces + <info> + </info> + 2 spaces
|
// + 17 = 2 spaces + <info> + </info> + 2 spaces
|
||||||
preg_replace('/\s*\R\s*/', PHP_EOL.str_repeat(' ', $totalWidth + 17), $argument->getDescription()),
|
preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $argument->getDescription()),
|
||||||
$default
|
$default
|
||||||
), $options);
|
), $options);
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ class TextDescriptor extends Descriptor
|
|||||||
$synopsis,
|
$synopsis,
|
||||||
str_repeat(' ', $spacingWidth),
|
str_repeat(' ', $spacingWidth),
|
||||||
// + 17 = 2 spaces + <info> + </info> + 2 spaces
|
// + 17 = 2 spaces + <info> + </info> + 2 spaces
|
||||||
preg_replace('/\s*\R\s*/', "\n".str_repeat(' ', $totalWidth + 17), $option->getDescription()),
|
preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 17), $option->getDescription()),
|
||||||
$default,
|
$default,
|
||||||
$option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''
|
$option->isArray() ? '<comment> (multiple values allowed)</comment>' : ''
|
||||||
), $options);
|
), $options);
|
||||||
|
@ -97,15 +97,46 @@ class LoggerDataCollector extends DataCollector implements LateDataCollectorInte
|
|||||||
|
|
||||||
private function sanitizeLogs($logs)
|
private function sanitizeLogs($logs)
|
||||||
{
|
{
|
||||||
foreach ($logs as $i => $log) {
|
$errorContextById = array();
|
||||||
|
$sanitizedLogs = array();
|
||||||
|
|
||||||
|
foreach ($logs as $log) {
|
||||||
$context = $this->sanitizeContext($log['context']);
|
$context = $this->sanitizeContext($log['context']);
|
||||||
if (isset($context['type'], $context['level']) && !($context['type'] & $context['level'])) {
|
|
||||||
$context['scream'] = true;
|
if (isset($context['type'], $context['file'], $context['line'], $context['level'])) {
|
||||||
|
$errorId = md5("{$context['type']}/{$context['line']}/{$context['file']}\x00{$log['message']}", true);
|
||||||
|
$silenced = !($context['type'] & $context['level']);
|
||||||
|
|
||||||
|
if (isset($errorContextById[$errorId])) {
|
||||||
|
if (isset($errorContextById[$errorId]['errorCount'])) {
|
||||||
|
++$errorContextById[$errorId]['errorCount'];
|
||||||
|
} else {
|
||||||
|
$errorContextById[$errorId]['errorCount'] = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$silenced && isset($errorContextById[$errorId]['scream'])) {
|
||||||
|
unset($errorContextById[$errorId]['scream']);
|
||||||
|
$errorContextById[$errorId]['level'] = $context['level'];
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$errorContextById[$errorId] = &$context;
|
||||||
|
if ($silenced) {
|
||||||
|
$context['scream'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$log['context'] = &$context;
|
||||||
|
unset($context);
|
||||||
|
} else {
|
||||||
|
$log['context'] = $context;
|
||||||
}
|
}
|
||||||
$logs[$i]['context'] = $context;
|
|
||||||
|
$sanitizedLogs[] = $log;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $logs;
|
return $sanitizedLogs;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sanitizeContext($context)
|
private function sanitizeContext($context)
|
||||||
|
@ -75,8 +75,18 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase
|
|||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
1,
|
1,
|
||||||
array(array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => 0), 'priority' => 100, 'priorityName' => 'DEBUG')),
|
array(array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => 0, 'file' => __FILE__, 'line' => 123), 'priority' => 100, 'priorityName' => 'DEBUG')),
|
||||||
array(array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => 0, 'scream' => true), 'priority' => 100, 'priorityName' => 'DEBUG')),
|
array(array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => 0, 'file' => __FILE__, 'line' => 123, 'scream' => true), 'priority' => 100, 'priorityName' => 'DEBUG')),
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
1,
|
||||||
|
array(
|
||||||
|
array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => 0, 'file' => __FILE__, 'line' => 123), 'priority' => 100, 'priorityName' => 'DEBUG'),
|
||||||
|
array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => -1, 'file' => __FILE__, 'line' => 123), 'priority' => 100, 'priorityName' => 'DEBUG'),
|
||||||
|
),
|
||||||
|
array(array('message' => 'foo3', 'context' => array('type' => E_USER_WARNING, 'level' => -1, 'file' => __FILE__, 'line' => 123, 'errorCount' => 2), 'priority' => 100, 'priorityName' => 'DEBUG')),
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
),
|
),
|
||||||
|
@ -209,6 +209,9 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testConstructorDenormalizeWithOptionalDefaultArgument()
|
public function testConstructorDenormalizeWithOptionalDefaultArgument()
|
||||||
{
|
{
|
||||||
|
if (PHP_VERSION_ID <= 50316) {
|
||||||
|
$this->markTestSkipped('See https://bugs.php.net/62715');
|
||||||
|
}
|
||||||
$obj = $this->normalizer->denormalize(
|
$obj = $this->normalizer->denormalize(
|
||||||
array('bar' => 'test'),
|
array('bar' => 'test'),
|
||||||
__NAMESPACE__.'\GetConstructorArgsWithDefaultValueDummy', 'any');
|
__NAMESPACE__.'\GetConstructorArgsWithDefaultValueDummy', 'any');
|
||||||
|
@ -157,6 +157,9 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testConstructorDenormalizeWithOptionalDefaultArgument()
|
public function testConstructorDenormalizeWithOptionalDefaultArgument()
|
||||||
{
|
{
|
||||||
|
if (PHP_VERSION_ID <= 50316) {
|
||||||
|
$this->markTestSkipped('See https://bugs.php.net/62715');
|
||||||
|
}
|
||||||
$obj = $this->normalizer->denormalize(
|
$obj = $this->normalizer->denormalize(
|
||||||
array('bar' => 'test'),
|
array('bar' => 'test'),
|
||||||
__NAMESPACE__.'\ObjectConstructorArgsWithDefaultValueDummy', 'any');
|
__NAMESPACE__.'\ObjectConstructorArgsWithDefaultValueDummy', 'any');
|
||||||
|
Reference in New Issue
Block a user