Posted by chx on August 7, 2012 at 9:26am
10 followers
| Project: | Drupal core |
| Version: | 6.x-dev |
| Component: | documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | chx |
| Status: | closed (fixed) |
| Issue tags: | needs backport to D6 |
Issue Summary
Even a core test did this. Blargh!
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| hook_exit_clarify.patch | 743 bytes | Idle | PASSED: [[SimpleTest]]: [MySQL] 39,830 pass(es). | View details |
Comments
#1
If nothing breaks when you print, the "MUST" is a bit too strong. This hook can't send anything to the browser?
#2
I think this change is good -- the hook docs already said you can't print, and this just clarifies why... but that is a good question. What does "already sent to the browser" mean really? I thought the output would only be sent to the browser when exit() is called in the PHP code?
#3
Output is also sent on flush(). While D6 and D7 core does not flush, D8 does and a contrib might earlier. Also, FPM has fastcgi_finish_request command which (surprise!) finishes the request :) ie closes the output and D8 calls that if it can.
#4
Good point. I think this patch is a good idea then. I'll leave it for a few days at RTBC before I do any committing of it though (which might turn into a week if one of the other committers doesn't grab it, as I'm traveling)... just in case there are dissenting opinions.
#5
Yep fair enough. Committed/pushed to 8x, moving to 7.x for backport.
#6
It applied with -p2 just fine.
#7
Oh and it's 7.x
#8
Committed and pushed to 7.x. Thanks!
One more time. :)
#9
x
#10
Current D6 documentation says: "It is often used for page logging and printing out debugging information.". So, under D6 can we print in hook_exit()?
#11
I am not 100% whether enhancing D6 documentation is anyone's priority at this stage. Nor I believe that committing this would make anyone change their code and finally I have no idea what to do under D6 instead of hook_exit.
#12
Automatically closed -- issue fixed for 2 weeks with no activity.