Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53868 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58419 invoked from network); 11 Jul 2011 11:16:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jul 2011 11:16:33 -0000 Authentication-Results: pb1.pair.com smtp.mail=arraypad@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=arraypad@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: arraypad@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:57937] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/D1-47764-09BDA1E4 for ; Mon, 11 Jul 2011 07:16:32 -0400 Received: by vxi39 with SMTP id 39so2937033vxi.29 for ; Mon, 11 Jul 2011 04:16:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=4rrKNlzlllNsV8j4mYR6IOsdEs57LRwNShDv4X97Mow=; b=YZTsbhgbsLwTTZlNrWTZdpktIeerArp2rOQNOitFHHgM4pgEXdfldLKgNLWZjgOItQ skfJKyrYG3v7UScCdpZU0HMwxYg2GFVxE97ZNvx/FAnGGJgdKAJ3njchms/UQvGeYmkd sfXpa6uuAUdXG11vLilRCehqJ27o4z1YnP5Gw= MIME-Version: 1.0 Received: by 10.52.67.116 with SMTP id m20mr912591vdt.52.1310382989649; Mon, 11 Jul 2011 04:16:29 -0700 (PDT) Received: by 10.52.184.98 with HTTP; Mon, 11 Jul 2011 04:16:29 -0700 (PDT) In-Reply-To: References: Date: Mon, 11 Jul 2011 12:16:29 +0100 Message-ID: To: Felipe Pena Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Object oriented session handlers From: arraypad@gmail.com (Arpad Ray) On Sun, Jul 3, 2011 at 4:15 PM, Felipe Pena wrote: > I like the idea (and voted +1 on it), but I've some consideration to do: > > +/* {{{ proto bool SessionHandler::open(string save_path, string session_= name) > + =A0 Wraps the old open handler */ > +PHP_METHOD(SessionHandler, open) > +{ > + =A0 =A0 =A0 PS_SANITY_CHECK; > + > + =A0 =A0 =A0 PS(mod_user_is_open) =3D 1; > + =A0 =A0 =A0 RETVAL_LONG(PS(default_mod)->s_open(&PS(mod_data), PS(save_= path), > PS(session_name) TSRMLS_CC)); > +} > [..] > +ZEND_BEGIN_ARG_INFO(arginfo_session_class_open, 0) > + =A0 =A0 =A0 ZEND_ARG_INFO(0, save_path) > + =A0 =A0 =A0 ZEND_ARG_INFO(0, session_name) > +ZEND_END_ARG_INFO() > > This method does not take the save_path and session_name parameter, it > just use the INI entry. > > This lead to following behavior: > $x =3D new SessionHandler > $x->open(1,2,3,4); // param is not used, and no param check at all > > It's missing void param check for the close method as well. > Hi, Thanks for pointing that out. I've updated the patch with the param checks and a couple of tests. Note that the close call still proceeds if it gets arguments, although it raises the standard warning, because the default handler would otherwise be left dangling. The new patches (including 5.4 now): http://spellign.com/patches/php-trunk-session-oo11.patch http://spellign.com/patches/php-5.4-session-oo11.patch http://spellign.com/patches/php-session-oo11-tests.patch Cheers, Arpad