-
-
Notifications
You must be signed in to change notification settings - Fork 101
Bugfix: PHP on internal webserver + win + env ANSICON set #2
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
Bugfix: PHP on internal webserver + win + env ANSICON set #2
Conversation
This fixes a bug with formatted output (formatted for CLI instead Web) when running PHP on internal webserver on windows with having ANSICON set.
ping @nicolas-grekas |
I'm confused, this can't be the right fix unless I miss something: this line is only for reducing the color palette to 16. Nothing related to the internal webserver. CLI vs HTML mode is made in src/Symfony/Component/VarDumper/VarDumper.php. |
This is the fix for the following scenario - Sry but I can't provide a reproducer script/gist - but more Details and if you read the following line for line I'm pretty sure you will get me :) : The facts:
... and exactly THIS is the problem: The CliDumper needs a (not specially mine but any) additional check to verify that it is really in CONSOLE mode cause it is definitively executed in Html mode as well - the line: read: If WINDOWS and ANSICON set true Another fix would be another structure AbstractDumper (core logic) and a CliDumper and a HtmlDuper both extending the this abstract base class not each other. This would be also a bit cleaner from my point of view. Please don't get me wrong: Not saying it's dirty implemented! ;) Thanks for all your work - i really like this piece of software. |
Understood! See symfony/symfony#15804 |
… (nicolas-grekas) This PR was merged into the 2.7 branch. Discussion ---------- [VarDumper] Fix HtmlDumper constructor calling CliDumper's | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/var-dumper#2 (comment) | License | MIT | Doc PR | - Commits ------- 4c7bb9c [VarDumper] Fix HtmlDumper constructor calling CliDumper's
Fixed |
…afimArts) This PR was squashed before being merged into the 6.2 branch. Discussion ---------- [VarDumper] Add `FFI\CData` and `FFI\CType` types | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Added support of FFI: ```php $ffi = \FFI::cdef(<<<'CPP' typedef struct { int x; int y; } Point; typedef struct Example { uint8_t array[32]; long longVal; __extension__ union { __extension__ struct { short shortVal; }; struct { Point point; float e; }; }; bool boolValue; int (*func)(struct __sub *h); } Example; CPP); $struct = $ffi->new('Example'); $struct->func = (static fn (object $ptr) => 42); dump($struct); ``` **Before** ``` FFI\CData {#2} ``` **After** ``` FFI\CData<struct Example> size 64 align 8 {#2 +array: FFI\CData<uint8_t[32]> size 32 align 1 {#18} +int32_t longVal: 0 +int16_t shortVal: 0 +point: FFI\CData<struct <anonymous>> size 8 align 4 {#17 +int32_t x: 0 +int32_t y: 0 } +float e: 0.0 +bool boolValue: false +func: [cdecl] callable(struct __sub*): int32_t {#20 returnType: FFI\CType<int32_t> size 4 align 4 {#25} } } ``` P.S. I apologize for the multiple force pushes, errors in tests and codestyle have been fixed. ## Review And TODOs - Pointers - [x] Pointer to scalar tests. - [x] Pointer to struct tests. - [x] "Special" pointer to `char*` tests (with `\0` and without `\0`). - Possible Errors - [x] Do not dump union fields with pointer references (possible SIGSEGV). Commits ------- 1c7dc52abb [VarDumper] Add `FFI\CData` and `FFI\CType` types
Email template fix
This fixes a bug with formatted output (formatted for CLI instead Web) when running PHP on internal webserver on windows with having ANSICON set.