bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-grekas)
This PR was merged into the 2.7 branch.
Discussion
----------
[VarDumper] Move locale sniffing to dump() time
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #23572
| License | MIT
| Doc PR | -
Commits
-------
eed8a5143d
[VarDumper] Move locale sniffing to dump() time
This commit is contained in:
commit
2040770da5
@ -39,8 +39,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||||||
public function __construct($output = null, $charset = null)
|
public function __construct($output = null, $charset = null)
|
||||||
{
|
{
|
||||||
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
||||||
$this->decimalPoint = (string) 0.5;
|
$this->decimalPoint = localeconv();
|
||||||
$this->decimalPoint = $this->decimalPoint[1];
|
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||||
$this->setOutput($output ?: static::$defaultOutput);
|
$this->setOutput($output ?: static::$defaultOutput);
|
||||||
if (!$output && is_string(static::$defaultOutput)) {
|
if (!$output && is_string(static::$defaultOutput)) {
|
||||||
static::$defaultOutput = $this->outputStream;
|
static::$defaultOutput = $this->outputStream;
|
||||||
@ -134,6 +134,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||||||
*/
|
*/
|
||||||
public function dump(Data $data, $output = null)
|
public function dump(Data $data, $output = null)
|
||||||
{
|
{
|
||||||
|
$this->decimalPoint = localeconv();
|
||||||
|
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||||
|
|
||||||
$exception = null;
|
$exception = null;
|
||||||
if ($output) {
|
if ($output) {
|
||||||
$prevOutput = $this->setOutput($output);
|
$prevOutput = $this->setOutput($output);
|
||||||
|
Reference in New Issue
Block a user