Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18716 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30021 invoked by uid 1010); 8 Sep 2005 11:48:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 30006 invoked from network); 8 Sep 2005 11:48:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Sep 2005 11:48:46 -0000 X-Host-Fingerprint: 80.5.118.146 cpc1-ersk1-4-0-cust146.renf.cable.ntl.com Received: from ([80.5.118.146:11230] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 39/71-23233-D1520234 for ; Thu, 08 Sep 2005 07:48:46 -0400 To: internals@lists.php.net,Derick Rethans Message-ID: <43202528.9010104@ntlworld.com> Date: Thu, 08 Sep 2005 12:48:56 +0100 User-Agent: Thunderbird 1.0+ (Windows/20050814) MIME-Version: 1.0 CC: Stanislav Malyshev , internals@lists.php.net References: <5.1.0.14.2.20050904235929.06963d60@localhost> <431D9B9E.6080303@ntlworld.com> <57792e85050906111963cd6303@mail.gmail.com> <6.2.3.4.2.20050907164645.0905ed90@localhost> <43201B61.4070306@emini.dk> In-Reply-To: Content-Type: multipart/mixed; boundary="------------000907050000050403040607" X-Posted-By: 80.5.118.146 Subject: Re: [PHP-DEV] Re: 5.0.5 From: scottmacvicar@ntlworld.com (Scott MacVicar) --------------000907050000050403040607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Path for 5.0.6, it would seem odd to have a different behavior on the 5.0.x branch. Scott Derick Rethans wrote: > On Thu, 8 Sep 2005, Stanislav Malyshev wrote: > >> DR>>But they can still do that.. With "shutdown functions" I meant >> DR>>functions registered with register_shutdown_function(). >> >> Ah... This is smaller problem - register_shutdown_function() ones can be >> called on "before dtors" stage. > > Indeed, we've always done this too... I've a patch ready to commit for > PHP 5.1/6.0 for this: > > diff -u -p -d -r1.640 main.c > --- main.c 5 Aug 2005 21:44:26 -0000 1.640 > +++ main.c 8 Sep 2005 11:33:43 -0000 > @@ -1197,16 +1197,16 @@ void php_request_shutdown(void *dummy) > EG(opline_ptr) = NULL; > EG(active_op_array) = NULL; > > - /* 1. Call all possible __destruct() functions */ > - zend_try { > - zend_call_destructors(TSRMLS_C); > - } zend_end_try(); > - > - /* 2. Call all possible shutdown functions registered with register_shutdown_function() */ > + /* 1. Call all possible shutdown functions registered with register_shutdown_function() */ > if (PG(modules_activated)) zend_try { > php_call_shutdown_functions(TSRMLS_C); > } zend_end_try(); > > + /* 2. Call all possible __destruct() functions */ > + zend_try { > + zend_call_destructors(TSRMLS_C); > + } zend_end_try(); > + > /* 3. Flush all output buffers */ > zend_try { > php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC); > > > Derick --------------000907050000050403040607 Content-Type: text/plain; name="patch-5_0.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-5_0.txt" Index: main/main.c =================================================================== RCS file: /repository/php-src/main/main.c,v retrieving revision 1.604.2.22 diff -u -r1.604.2.22 main.c --- main/main.c 16 Aug 2005 18:11:34 -0000 1.604.2.22 +++ main/main.c 6 Sep 2005 13:34:15 -0000 @@ -1194,14 +1194,14 @@ sapi_send_headers(TSRMLS_C); } zend_end_try(); + if (PG(modules_activated)) zend_try { + php_call_shutdown_functions(TSRMLS_C); + } zend_end_try(); + zend_try { zend_call_destructors(TSRMLS_C); } zend_end_try(); - if (PG(modules_activated)) zend_try { - php_call_shutdown_functions(TSRMLS_C); - } zend_end_try(); - if (PG(modules_activated)) { zend_deactivate_modules(TSRMLS_C); php_free_shutdown_functions(TSRMLS_C); --------------000907050000050403040607--