Skip to content

Commit 5c46e39

Browse files
committed
Merge branch '3.3' into 3.4
* 3.3: removed extra whitespace Removes \n or space when / are empty [HttpFoundation] add Early Hints in Reponse to fix test Throwing exception if redis and predis unavailable
2 parents 996f6ef + 3b54b3d commit 5c46e39

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,20 @@ public function format(array $record)
117117
$levelColor = self::$levelColorMap[$record['level']];
118118

119119
if ($this->options['multiline']) {
120-
$context = $extra = "\n";
120+
$separator = "\n";
121121
} else {
122-
$context = $extra = ' ';
122+
$separator = ' ';
123+
}
124+
125+
$context = $this->dumpData($record['context']);
126+
if ($context) {
127+
$context = $separator.$context;
128+
}
129+
130+
$extra = $this->dumpData($record['extra']);
131+
if ($extra) {
132+
$extra = $separator.$extra;
123133
}
124-
$context .= $this->dumpData($record['context']);
125-
$extra .= $this->dumpData($record['extra']);
126134

127135
$formatted = strtr($this->options['format'], array(
128136
'%datetime%' => $record['datetime']->format($this->options['date_format']),

src/Symfony/Component/Cache/Traits/RedisTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Predis\Connection\Aggregate\PredisCluster;
1717
use Predis\Connection\Aggregate\RedisCluster;
1818
use Predis\Response\Status;
19+
use Symfony\Component\Cache\Exception\CacheException;
1920
use Symfony\Component\Cache\Exception\InvalidArgumentException;
2021

2122
/**
@@ -108,6 +109,9 @@ public static function createConnection($dsn, array $options = array())
108109
$params += $query;
109110
}
110111
$params += $options + self::$defaultConnectionOptions;
112+
if (null === $params['class'] && !extension_loaded('redis') && !class_exists(\Predis\Client::class)) {
113+
throw new CacheException(sprintf('Cannot find the "redis" extension, and "predis/predis" is not installed: %s', $dsn));
114+
}
111115
$class = null === $params['class'] ? (extension_loaded('redis') ? \Redis::class : \Predis\Client::class) : $params['class'];
112116

113117
if (is_a($class, \Redis::class, true)) {

src/Symfony/Component/HttpFoundation/Response.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ class Response
126126
100 => 'Continue',
127127
101 => 'Switching Protocols',
128128
102 => 'Processing', // RFC2518
129+
103 => 'Early Hints',
129130
200 => 'OK',
130131
201 => 'Created',
131132
202 => 'Accepted',

0 commit comments

Comments
 (0)