https://wiki.php.net/rfc/request-tempnam
Just a bit of hand-holding for those who don't remember to clean up
their messes.
Hi,
https://wiki.php.net/rfc/request-tempnam
Just a bit of hand-holding for those who don't remember to clean up
their messes.
An obvious question is: When in shutdown should that be called? Assume I
have a session handler which uses such a temporary directory which is
backed by a custom stream while having a registered shutdown function
accessing that session (what did i forget to put into that scenario?)
johannes
An obvious question is: When in shutdown should that be called? Assume I
have a session handler which uses such a temporary directory which is
backed by a custom stream while having a registered shutdown function
accessing that session (what did i forget to put into that scenario?)
Is this custom session handler wanting the temporary directory to last
between requests?
If so then they'd just not use the TEMPNAM_REQUEST flag.
If not, then there wouldn't be a problem since RSHUTDOWN happens after
calling the methods registered with register_shutdown_function()
.
-Sara
Good idea!
Am 26.11.2012 um 22:21 schrieb Sara Golemon pollita@php.net:
https://wiki.php.net/rfc/request-tempnam
Just a bit of hand-holding for those who don't remember to clean up
their messes.
https://wiki.php.net/rfc/request-tempnam
Just a bit of hand-holding for those who don't remember to clean up
their messes.--
While I don't think there's anything wrong with this feature, I'm also
wondering if maybe people that need this should be using tmpfile()
instead?
I understand they do slightly different things (in that one gives you an
actual file name the other gives you a file handle), but I normally don't
need or care about the file name if I expect my temporary file to live and
die with the request.
Things I usually use tempnam()
for are usually things that get born with
the request and don't necessarily die with it, like binary storage that's
tied to the session (temporary file uploads that might be moved later or
deleted).
But I don't see any harm in adding this either.