Run shutdown handlers before running request-exit cleanup
commit35fafe5545d96416d4b7e6f3d6421392c9da0801
authorOwen Yamauchi <oyamauchi@fb.com>
Wed, 19 Jun 2013 17:14:02 +0000 (19 10:14 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 21 Jun 2013 18:19:34 +0000 (21 11:19 -0700)
tree2a46a2d3fddf9775af6d51fc509d2b820d277dc1
parent07fe7cd4a05321b02770eaf11662110816fa060e
Run shutdown handlers before running request-exit cleanup

Shutdown handlers can run user code (e.g. the session stuff serializes
the session and can pass the serialized blob to user code to do
something with), so it's generally not safe to run them after
requestExit(). In particular, requestExit destroys global variables, and
the session serializer reads $_SESSION.

My recent diff to get rid of the hardcoded globals exposed this, though
I argue this situation was incorrect all along.
hphp/runtime/base/program_functions.cpp