Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86655 invoked from network); 27 Jun 2011 03:49:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Jun 2011 03:49:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.27 cause and error) X-PHP-List-Original-Sender: larry@garfieldtech.com X-Host-Fingerprint: 66.111.4.27 out3.smtp.messagingengine.com Received: from [66.111.4.27] ([66.111.4.27:52506] helo=out3.smtp.messagingengine.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 49/12-06575-5CDF70E4 for ; Sun, 26 Jun 2011 23:49:25 -0400 Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.messagingengine.com (Postfix) with ESMTP id 8791B20D59 for ; Sun, 26 Jun 2011 23:49:22 -0400 (EDT) Received: from frontend2.messagingengine.com ([10.202.2.161]) by compute5.internal (MEProxy); Sun, 26 Jun 2011 23:49:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=YT9DVaQPYp6khdeRVXE/4Cf8xKg=; b=YvMX94Ah5pa+jnoQJflzyqH855R2ZSMiXt+/Ovst8oAd+p2Xg4Y35IxATRCvaIXPvrWNZvqVA5wo6UKCpRAt+D9Po/4a0YfpVnCAdZOcH8o3Kyzn3Kr0NRAeKqofS+qaiNZnjduI6mWrKp08L9cFHUdzx0BfLlRmZNAR5gLJSLY= X-Sasl-enc: sqcb+X7Vtyy4u+4c5FhYe0dAjfTWOe7TtKtGspVSo3/e 1309146562 Received: from linux-nkec.site (c-71-57-95-65.hsd1.il.comcast.net [71.57.95.65]) by mail.messagingengine.com (Postfix) with ESMTPSA id 0B934441676 for ; Sun, 26 Jun 2011 23:49:21 -0400 (EDT) Message-ID: <4E07FE98.9080002@garfieldtech.com> Date: Sun, 26 Jun 2011 22:52:56 -0500 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Object oriented session handlers From: larry@garfieldtech.com (Larry Garfield) On 06/25/2011 12:13 AM, Arpad Ray wrote: > Hi, > > I've updated the patches again. > > The most significant change is that the shutdown function registers > another shutdown function when it's called, to (almost) ensure that > it's always the last one, and therefore user shutdown functions should > always find the session available as expected. I'd especially > appreciate feedback or improvements on this because it feels very > hacky. One option is to add a separate hash of internal shutdown > functions which run after the user shutdown functions, another is to > add an element to the module entry, a la RSHUTDOWN, which gets run in > between steps 1 and 2 in the shutdown process (see main.c:1632). > > I don't know what other uses there are for this, so I've stuck with > the double shutdown function method in this patch. I'd also like to > avoid complicating the vote on this patch with a tangential issue. > > I've added a second optional argument to > session_set_save_handler($obj) which is true by default and indicates > whether the shutdown function should be registered - this is so that > users with their own manual shutdown procedure can disable the > automatic approach. I think that most users will take advantage of the > automatically registered shutdown function, but this lets those with a > custom shutdown procedure handle the session shutdown within the > lifetime of the script and save the slight overhead. > > http://spellign.com/patches/php-trunk-session-oo10.patch > http://spellign.com/patches/php-trunk-session-oo10-tests.patch > > Regards, > > Arpad I'm a bit confused. If the session handler goes out of its way to ensure that it's the last thing to run, wouldn't that cause an issue if it tries to write session data after, say, the database connection object it wants to use has already been cleaned up? Or is that the use case for the "do not register" parameter? It seems like it would be a fairly common use case... --Larry Garfield