Re: Account request for vdump extension
| From: | Jille Timmermans | Date: | Fri, 04 Jan 2013 10:08:49 +0000 |
| Subject: | Re: Account request for vdump extension | ||
| References: | 1 2 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-10158@lists.php.net to get a copy of this message | ||
Hi,
Op 16-12-12 18:30, Johannes Schlüter schreef:
Hi, On Sun, 2012-12-16 at 00:45 +0100, Jille Timmermans wrote:Hello list, I would like to have the vdump extension listed in PECL. The idea is quite simple: It adds a function vdump_dump($file) which allows the programmer to dump all variables to $file which can be a great aid in debugging. The code can be found at https://github.com/hexon/php-vdump.I myself would in most situations prefer to use a debugger like xdebug to do this but well nontheless I think this could be added. But a few comments: 1) What's the license? The code carries no license, neither do you state in this mail. I will look into that.
2) Have you looked into php_var_export_ex() from php_var.h, I think you might use it instead of your own solution in vdump_add_zval() I decided not to use it for a few reasons:* It uses smart_str instead of writing directly to a file which might be a burden if memory is critical. * It doesn't work for circular references where vdump want to give a perfect representation of the data structures. * It didn't work with references the way I wanted to
3) Your php_vdump.h is relatively long. In general it is good practice to keep it small as it will be included from main/builtin_functions.c if the extension is built statically. IIRC it was mostly auto-generated by ext_skel but I will trim it down as far as possible.
4) Having #define _GNU_SOURCE is always a bit suspicious. I don't see it's needed (might have missed some libc call though) IIRC that was for asprintf(3)
5) I don't think MINFO is a good place for credits (while this is pecl which is less strict and even in core we have examples doing that...) I will remove it.It's been quite some time since I wrote the code and I see it can use some cleaning up. I will do that when I can find some spare time. Thanks for your feedback. -- Jille
johannes