php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63072 Request: function as register_shutdown_function, but as it was before PHP 4.1.0
Submitted: 2012-09-12 15:04 UTC Modified: 2017-09-27 14:13 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: zdexter_cds at hotmail dot com Assigned: cmb (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.4.6 OS: Anyone
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zdexter_cds at hotmail dot com
New email:
PHP Version: OS:

 

 [2012-09-12 15:04 UTC] zdexter_cds at hotmail dot com
Description:
------------
I'm asking for a function as register_shutdown_function used to be, when it 
executed after client disconnects.

Reason: Get faster responses to the user when some considerably 'slow' process 
might be executed in background, after processes.

I know it could be done by some custom function, as well as it's possible 
through Output Control Buffers Functions, but it's more code to write, more 
commands to be processed by server and it'd 'conflict' with output_buffering 
setting from php.ini so you'd also need to manage it.

Also, the current function could be simulated easier than the old one, but it's 
the one chosen.

It can easily be done by you, as it's just copy & paste, so I hope it's 
implemented.

Thanks in advance.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-12 15:08 UTC] zdexter_cds at hotmail dot com
-Package: Output Control +Package: Unknown/Other Function
 [2012-09-12 15:08 UTC] zdexter_cds at hotmail dot com
Edit: bug type changed.
 [2012-09-14 10:54 UTC] laruence@php.net
1. you can flush you output as soon as possible, then run other functions
2. you can using ajax
3. fpm has that ability: fastcgi_finish_request()

but such function will be very limited, like it can not output anything.
 [2012-09-14 20:15 UTC] zdexter_cds at hotmail dot com
1. you can flush you output as soon as possible, then run other functions
2. you can using ajax
3. fpm has that ability: fastcgi_finish_request()
------------------------------------------------------------------------

1.Even if you flush, request still waits till header "close" and full size of data is received, so request is still open, but it's a way to partially solve the problem.

2. It'd generate undisered requests to server, it's more like a jerry-rig to something could be solved in just one step.

3. If fpm has it, php could have it by default in other cases too.

"but such function will be very limited, like it can not output anything."
I know, but it'd be great, consider it, please.
 [2014-08-11 14:19 UTC] zdexter_cds at hotmail dot com
Bumping this feature, since I don't understand the use of register_shutdown_function being used as part of request.

If you want a function to be part of request, just put it before exit or in the request, right?

But if you want a function after the request you need to use Output Control Functions, which makes you code unecessary text to control header lenght, a thing most devs won't want because php already does it automatically, turning ur code big and poor since it was not needed with rsf original functionality.
 [2014-08-11 14:42 UTC] zdexter_cds at hotmail dot com
Also, with apache compression ob functions won't work, so it's a lot of work to just reproduce a function which had some functionality and now has basicly none, since u can just put the functions at the end of script, the other case is not possible, you need to change the start, mid and end of script.
 [2017-06-01 05:20 UTC] zdexter_cds at hotmail dot com
You can close this request, it was a long time ago n I hadn't test n dind't know correctly the essence of such things like fastcgi_finish_request() in that time. Thanks!
 [2017-09-27 14:13 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2017-09-27 14:13 UTC] cmb@php.net
Closing as requested by OP.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 13:01:30 2024 UTC