Skip to content

Commit

Permalink
bug #23574 [VarDumper] Move locale sniffing to dump() time (nicolas-g…
Browse files Browse the repository at this point in the history
…rekas)

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
-------

eed8a51 [VarDumper] Move locale sniffing to dump() time
  • Loading branch information
fabpot committed Jul 19, 2017
2 parents 910a8de + eed8a51 commit 2040770
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php
Expand Up @@ -39,8 +39,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public function __construct($output = null, $charset = null)
{
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
$this->decimalPoint = (string) 0.5;
$this->decimalPoint = $this->decimalPoint[1];
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];
$this->setOutput($output ?: static::$defaultOutput);
if (!$output && is_string(static::$defaultOutput)) {
static::$defaultOutput = $this->outputStream;
Expand Down Expand Up @@ -134,6 +134,9 @@ public function setIndentPad($pad)
*/
public function dump(Data $data, $output = null)
{
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];

$exception = null;
if ($output) {
$prevOutput = $this->setOutput($output);
Expand Down

0 comments on commit 2040770

Please sign in to comment.