Conversation
|
I like this, but what's the reason why it is called XDEBUG_FILE ? It's just an arbitrary value that you can get from the GET parameters into the trace/profile filenames. Would it not make sense to pick a name that doesn't include FILE? It would also be great if you could file an issue at http://bugs.xdebug.org as feature request, as per http://xdebug.org/contributing.php You probably should create a feature branch as well, instead of using "master". |
|
Hey @MoleDJ — are you still interested in this? |
|
Sorry for the delay, I already interested in this. the reason I want to add this is that I need to change the trace filename from the request side and I cannot use the url. In my exact setup, I need diferent trace file per each request I do, and I want to have this files named as I want so I can then match the results from webgrind to a database. Sorry If I didn't put the change in the correct place, is my first contribution in github :) |
|
Okay - I get that, but does the cookie needs to be called XDEBUG_FILE - instead of for example XDEBUG_EXTRA_INFO ? I can imagine other want to send something else and not a filename. |
|
Oh, cookie name not need to be XDEBUG_FILE. Can be extra_info or any other best fit on your name schema. |
8e87621 to
6acaefc
Compare
|
And here should option to disable this behavior |
derickr
left a comment
There was a problem hiding this comment.
I've some questions/requests.
| sess_name = "XDEBUG_FILE"; | ||
|
|
||
| if (PG(http_globals)[TRACK_VARS_COOKIE] && | ||
| zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), sess_name, strlen(sess_name) + 1, (void **) &data) == SUCCESS && |
There was a problem hiding this comment.
I prefer sizeof(sess_name) here, and probably I'd prefer that line 656 and 658 are the same.
I would also argue that the name should not be XDEBUG_FILE, but instead XDEBUG_EXTRA_INFO.
What would be even better if it was an #define somewhere as a "constant".
|
|
||
| if (PG(http_globals)[TRACK_VARS_COOKIE] && | ||
| zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), sess_name, strlen(sess_name) + 1, (void **) &data) == SUCCESS && | ||
| Z_STRLEN_PP(data) < 100 /* Prevent any unrealistically long data being set as filename */ |
There was a problem hiding this comment.
The value "100" should also be a constant.
| } | ||
| } break; | ||
|
|
||
| case 'K': { /* XDEBUG_FILE in cookie */ |
There was a problem hiding this comment.
Why did you pick "K" ? Can we make it "X", according to the xdebug_eXtra_info ?
|
Sorry, I'm just looking again at old(er) PRs. @andypost , why should there be an option to disable this? |
|
@derickr I misunderstood, as I see it escapes |
Add new format to xdebug.trace_output_name to allow set the filename from $_COOKIE "XDEBUG_FILE"
%K filename (from $_COOKIE if set) trace.%K trace.filename_in_set_in_the_XDEBUG_FILE_cookie.xt