Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53042 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10342 invoked from network); 6 Jun 2011 16:31:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jun 2011 16:31:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=rquadling@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rquadling@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rquadling@gmail.com X-Host-Fingerprint: 209.85.216.42 mail-qw0-f42.google.com Received: from [209.85.216.42] ([209.85.216.42:37947] helo=mail-qw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/B2-23189-AD00DED4 for ; Mon, 06 Jun 2011 12:31:23 -0400 Received: by qwi4 with SMTP id 4so2009375qwi.29 for ; Mon, 06 Jun 2011 09:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-type; bh=REMoNHu+owWzhUKrwcM23Gw8zwz5tvsAXKOEHtT8KR8=; b=LoqRShlbJfFdVBVelOOrkq7ZQzF0msICi9CqODOVWSd3RWthkWabMJ7R0Zali4u5lt JInbDDCeNNOVvDnbtwunagaxDX9LwjZijWfw9FA+reZCQUI7FFGtzBAw0Qk6sbRLd5J6 p+hlFmss5LKQ9AZBCS4J+j5MEdRkEvjsRVGWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; b=xl82+KTvum1k8i7ahuLyWUzpbPTJ2k2XgVpBnNee+A6NnA3mxa8RsXwt2rXFKJPvpe yc8/x+W3Uq0NI2JINgrM9WZZnw9x+pKT1I4MhvstwRHbNTmjxmXNRXPLoSea644foxCl NWVCjtvBMnFgP8LjVkN8uqXLwnppKeShiR3tE= Received: by 10.229.95.144 with SMTP id d16mr3712484qcn.37.1307377880084; Mon, 06 Jun 2011 09:31:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.80.79 with HTTP; Mon, 6 Jun 2011 09:31:00 -0700 (PDT) Reply-To: RQuadling@GMail.com In-Reply-To: References: Date: Mon, 6 Jun 2011 17:31:00 +0100 Message-ID: To: Arpad Ray Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Object oriented session handlers From: rquadling@gmail.com (Richard Quadling) On 3 June 2011 02:18, Arpad Ray wrote: > Hi, > > A while ago I submitted a patch to allow session_set_save_handler() to > accept a class, and support the inheritance of the default session > handler's methods. > > The RFC has a more detailed description and the current patch: > https://wiki.php.net/rfc/session-oo > > Changes since this was last discussed: > - More sanity checking to prevent handlers being called in unexpected states > - ZTS fixes > > Any thoughts? > > Regards, > > Arpad Not an internals expert, but I do have a question. When would the session handler object be destroyed? If sessions are being logged to a DB (maybe via a userland PHP class), is internal reference counting enough to handle the order of destruction? If the DB connection is destroyed before the session handler gets it destructor called (or the session_write_close equivalent), the session won't be able to log the data and there would be no warning to the client as engine is in auto tidy up mode. Obviously, if the developer takes care and calls the destructors in the right order, then everything will be OK, but this is not something I see very often. What about circular references and interdependent references? -- Richard Quadling Twitter : EE : Zend : PHPDoc @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea