Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2cdc6d2

Browse filesBrowse files
Merge branch '3.2'
* 3.2: [Config] ConfigCache::isFresh() should return false on __PHP_Incomplete_Class [VarDumper] Use default color for ellipsed namespaces/paths mark alias as private during creation [Serializer] Remove unused GetSetMethodNormalizer::denormalize
2 parents 8835522 + bd5af67 commit 2cdc6d2
Copy full SHA for 2cdc6d2

File tree

Expand file treeCollapse file tree

6 files changed

+48
-38
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+48
-38
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Doctrine\Common\Annotations\Reader;
1515
use Symfony\Bridge\Monolog\Processor\DebugProcessor;
1616
use Symfony\Component\Cache\Adapter\AdapterInterface;
17+
use Symfony\Component\DependencyInjection\Alias;
1718
use Symfony\Component\DependencyInjection\ContainerBuilder;
1819
use Symfony\Component\DependencyInjection\ContainerInterface;
1920
use Symfony\Component\DependencyInjection\Definition;
@@ -1248,8 +1249,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con
12481249
}
12491250
foreach (array('doctrine', 'psr6', 'redis') as $name) {
12501251
if (isset($config[$name = 'default_'.$name.'_provider'])) {
1251-
$container->setAlias('cache.'.$name, Compiler\CachePoolPass::getServiceProvider($container, $config[$name]));
1252-
$container->getAlias('cache.'.$name)->setPublic(false);
1252+
$container->setAlias('cache.'.$name, new Alias(Compiler\CachePoolPass::getServiceProvider($container, $config[$name]), false));
12531253
}
12541254
}
12551255
foreach (array('app', 'system') as $name) {

‎src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ table.logs .metadata {
900900
#collector-content .sf-dump-note { color: #6897BB; }
901901
#collector-content .sf-dump-key { color: #789339; }
902902
#collector-content .sf-dump-ref { color: #6E6E6E; }
903+
#collector-content .sf-dump-ellipsis { color: #CC7832; max-width: 100em; }
903904

904905
#collector-content .sf-dump {
905906
margin: 0;

‎src/Symfony/Component/Config/ResourceCheckerConfigCache.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/ResourceCheckerConfigCache.php
+30-1Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,37 @@ public function isFresh()
7777
return true;
7878
}
7979

80+
$metadata = $this->getMetaFile();
81+
if (!is_file($metadata)) {
82+
return false;
83+
}
84+
85+
$e = null;
86+
$meta = false;
8087
$time = filemtime($this->file);
81-
$meta = unserialize(file_get_contents($metadata));
88+
$signalingException = new \UnexpectedValueException();
89+
$prevUnserializeHandler = ini_set('unserialize_callback_func', '');
90+
$prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) use (&$prevErrorHandler, $signalingException) {
91+
if (E_WARNING === $type && 'Class __PHP_Incomplete_Class has no unserializer' === $msg) {
92+
throw $signalingException;
93+
}
94+
95+
return $prevErrorHandler ? $prevErrorHandler($type, $msg, $file, $line, $context) : false;
96+
});
97+
98+
try {
99+
$meta = unserialize(file_get_contents($metadata));
100+
} catch (\Error $e) {
101+
} catch (\Exception $e) {
102+
}
103+
restore_error_handler();
104+
ini_set('unserialize_callback_func', $prevUnserializeHandler);
105+
if (null !== $e && $e !== $signalingException) {
106+
throw $e;
107+
}
108+
if (false === $meta) {
109+
return false;
110+
}
82111

83112
foreach ($meta as $resource) {
84113
/* @var ResourceInterface $resource */

‎src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/ResourceCheckerConfigCacheTest.php
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Config\Tests;
1313

1414
use Symfony\Component\Config\Tests\Resource\ResourceStub;
15+
use Symfony\Component\Config\Resource\FileResource;
1516
use Symfony\Component\Config\ResourceCheckerConfigCache;
1617

1718
class ResourceCheckerConfigCacheTest extends \PHPUnit_Framework_TestCase
@@ -108,6 +109,18 @@ public function testIsNotFreshWithchecker()
108109
$this->assertFalse($cache->isFresh());
109110
}
110111

112+
public function testCacheIsNotFreshWhenUnserializeFails()
113+
{
114+
$checker = $this->getMock('\Symfony\Component\Config\ResourceCheckerInterface');
115+
$cache = new ResourceCheckerConfigCache($this->cacheFile, array($checker));
116+
$cache->write('foo', array(new FileResource(__FILE__)));
117+
118+
$metaFile = "{$this->cacheFile}.meta";
119+
file_put_contents($metaFile, str_replace('FileResource', 'ClassNotHere', file_get_contents($metaFile)));
120+
121+
$this->assertFalse($cache->isFresh());
122+
}
123+
111124
public function testCacheKeepsContent()
112125
{
113126
$cache = new ResourceCheckerConfigCache($this->cacheFile);

‎src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php
-34Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,40 +36,6 @@ class GetSetMethodNormalizer extends AbstractObjectNormalizer
3636
{
3737
private static $setterAccessibleCache = array();
3838

39-
/**
40-
* {@inheritdoc}
41-
*
42-
* @throws RuntimeException
43-
*/
44-
public function denormalize($data, $class, $format = null, array $context = array())
45-
{
46-
$allowedAttributes = $this->getAllowedAttributes($class, $context, true);
47-
$normalizedData = $this->prepareForDenormalization($data);
48-
49-
$reflectionClass = new \ReflectionClass($class);
50-
$object = $this->instantiateObject($normalizedData, $class, $context, $reflectionClass, $allowedAttributes, $format);
51-
52-
$classMethods = get_class_methods($object);
53-
foreach ($normalizedData as $attribute => $value) {
54-
if ($this->nameConverter) {
55-
$attribute = $this->nameConverter->denormalize($attribute);
56-
}
57-
58-
$allowed = $allowedAttributes === false || in_array($attribute, $allowedAttributes);
59-
$ignored = in_array($attribute, $this->ignoredAttributes);
60-
61-
if ($allowed && !$ignored) {
62-
$setter = 'set'.ucfirst($attribute);
63-
64-
if (in_array($setter, $classMethods) && !$reflectionClass->getMethod($setter)->isStatic()) {
65-
$object->$setter($value);
66-
}
67-
}
68-
}
69-
70-
return $object;
71-
}
72-
7339
/**
7440
* {@inheritdoc}
7541
*/

‎src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class HtmlDumper extends CliDumper
4343
'meta' => 'color:#B729D9',
4444
'key' => 'color:#56DB3A',
4545
'index' => 'color:#1299DA',
46+
'ellipsis' => 'color:#FF8400',
4647
);
4748

4849
private $displayOptions = array(
@@ -380,7 +381,7 @@ function isCtrlKey(e) {
380381
display: inline-block;
381382
overflow: visible;
382383
text-overflow: ellipsis;
383-
width: 5em;
384+
max-width: 5em;
384385
white-space: nowrap;
385386
overflow: hidden;
386387
vertical-align: top;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.