Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53735 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93432 invoked from network); 3 Jul 2011 15:15:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Jul 2011 15:15:25 -0000 Authentication-Results: pb1.pair.com smtp.mail=felipensp@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=felipensp@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.42 as permitted sender) X-PHP-List-Original-Sender: felipensp@gmail.com X-Host-Fingerprint: 209.85.210.42 mail-pz0-f42.google.com Received: from [209.85.210.42] ([209.85.210.42:48433] helo=mail-pz0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1A/40-23482-B87801E4 for ; Sun, 03 Jul 2011 11:15:24 -0400 Received: by pzk37 with SMTP id 37so526777pzk.29 for ; Sun, 03 Jul 2011 08:15:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=yKcTb7guBq30u+ooyW8hYbyCKO+NxrCYWqAmWwieh84=; b=oKeie05hC5OAy3o8TRVZ1DoFHo3b1el7K4sDPjr29mbjqlI1Xh1zHZuUp5uy76Ai3M 1rMfFpOGrjDoRwyxtZYgPJpT2Z+X7/Kn0SVZ/La4c53uY2cpf4gV4v9nQq8tPMocdUXn eTg/QFP8zOOJ5unSZtQ/t4BZPkO5lFtRdJ1mw= Received: by 10.143.29.13 with SMTP id g13mr2125752wfj.221.1309706121164; Sun, 03 Jul 2011 08:15:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.222.16 with HTTP; Sun, 3 Jul 2011 08:15:01 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 Jul 2011 12:15:01 -0300 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: felipensp@gmail.com (Felipe Pena) Hi, 2011/6/2 Arpad Ray : > 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 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) + Wraps the old open handler */ +PHP_METHOD(SessionHandler, open) +{ + PS_SANITY_CHECK; + + PS(mod_user_is_open) = 1; + 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) + ZEND_ARG_INFO(0, save_path) + 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 = 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. Thank you for helping us make PHP better. :) -- Regards, Felipe Pena