Newsgroups: php.internals,php.internals Path: news.php.net Xref: news.php.net php.internals:18840 php.internals:18841 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84937 invoked by uid 1010); 13 Sep 2005 17:49:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84920 invoked from network); 13 Sep 2005 17:49:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2005 17:49:53 -0000 X-Host-Fingerprint: 80.5.118.146 cpc1-ersk1-4-0-cust146.renf.cable.ntl.com Received: from ([80.5.118.146:29252] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 6E/D5-58045-14117234 for ; Tue, 13 Sep 2005 13:49:53 -0400 To: internals@lists.php.net,Scott MacVicar Message-ID: <43271144.8020204@ntlworld.com> Date: Tue, 13 Sep 2005 18:49:56 +0100 User-Agent: Thunderbird 1.4 (Windows/20050908) MIME-Version: 1.0 CC: internals@lists.php.net, Derick Rethans , Stanislav Malyshev 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> <43202528.9010104@ntlworld.com> In-Reply-To: <43202528.9010104@ntlworld.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 80.5.118.146 Subject: Re: [PHP-DEV] Re: 5.0.5 From: scottmacvicar@ntlworld.com (Scott MacVicar) Any chance of getting these applied to 5.0.x and 5.1? Scott Scott MacVicar wrote: > 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 > > > ------------------------------------------------------------------------ > > 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);