Skip to content

[VarDumper] Use Unicode Control Pictures #12411

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 9, 2014
Merged

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

I wasn't satisfied with how control chars where dumped, until I found the Unicode Control Pictures.
This PR takes advantage of them:

capture du 2014-11-04 10 52 15

@nicolas-grekas
Copy link
Member Author

I added a not directly related commit to this:
I propose loading the dump() function declaration as soon as the VarDumper class is loaded.
Since this class is used by DebugBundle::boot(), this has the effect of autoloading the function when the bundle is loaded.
This ease the upgrade path for existing projects since they are not required anymore to inline the definition somewhere (in app/autoload.php in next sf-std edition).

@nicolas-grekas
Copy link
Member Author

The effect of this change (see symfony/symfony-standard#732 also) is that if an application has a call to dump() somewhere, a Fatal Error will be triggered when the DebugBundle is not enabled.
This is a wanted side-effect (prevents data leak).

@nicolas-grekas nicolas-grekas force-pushed the cchr branch 3 times, most recently from a36a707 to 2516118 Compare November 4, 2014 16:01
@fabpot
Copy link
Member

fabpot commented Nov 4, 2014

👍

@nicolas-grekas nicolas-grekas force-pushed the cchr branch 2 times, most recently from 5b20399 to fa4c084 Compare November 6, 2014 09:26
@fabpot
Copy link
Member

fabpot commented Nov 9, 2014

Thank you @nicolas-grekas.

fabpot added a commit to symfony/symfony-standard that referenced this pull request Nov 9, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

remove inline dump() declaration

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | ~

Replaced by symfony/symfony#12411

Commits
-------

532ccaf remove inline dump() declaration
@fabpot fabpot merged commit 6258ae8 into symfony:master Nov 9, 2014
fabpot added a commit that referenced this pull request Nov 9, 2014
This PR was merged into the 2.6-dev branch.

Discussion
----------

[VarDumper] Use Unicode Control Pictures

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

I wasn't satisfied with how control chars where dumped, until I found the [Unicode Control Pictures](http://www.unicode.org/charts/PDF/U2400.pdf).
This PR takes advantage of them:

![capture du 2014-11-04 10 52 15](https://cloud.githubusercontent.com/assets/243674/4897678/752fac20-6408-11e4-9186-7b788c9a88bb.png)

Commits
-------

6258ae8 [DebugBundle] remove README.md
50021bd [Debug] No gc_collect_cycles(), it's costly and can segfault
b592e90 [VarDumper] inline dump() function loading
cd076e4 [VarDumper] Use Unicode Control Pictures
@nicolas-grekas nicolas-grekas deleted the cchr branch November 10, 2014 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants