Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73473 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11297 invoked from network); 28 Mar 2014 22:03:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2014 22:03:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.176 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.176 mail-lb0-f176.google.com Received: from [209.85.217.176] ([209.85.217.176:36667] helo=mail-lb0-f176.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 64/61-33588-1B1F5335 for ; Fri, 28 Mar 2014 17:03:30 -0500 Received: by mail-lb0-f176.google.com with SMTP id 10so4081695lbg.7 for ; Fri, 28 Mar 2014 15:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=kP1UJEPyreFiL9DLwD50LhYSajIf/M5jKv4ZwXEVYBo=; b=f4kJ/5F4gAAN+MonGZnmMb2NZTrpwB1TwmLb5rjjwzDZYquQhMRW7UEshCiLcpecwh d2Ks5NC/PS413oWL1lhDAaI+/eLeEp4r2m7zubSVgpDem05u+h47xcRMacvT3cSa3ABy 7AqzEezIHWf9cHLubnZp04joB5d6PTgIyE+p4QIB5fIidQjtcD8tN/XTf9EEV4U+e9XS g4r4VLTDMGaCsQk8qeJ045uJCkLp8/LC26qHK03TWCKlXLVYvODqLSil0h5ciQ22Fl9c McoKZDHXoebZt5wko5YNtgzALbbDUV+062cF6iC5LZovW2MCln7Oz0hvjKV7WCBfPX5e l0kg== X-Received: by 10.112.52.104 with SMTP id s8mr6903581lbo.7.1396044206723; Fri, 28 Mar 2014 15:03:26 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.205.73 with HTTP; Fri, 28 Mar 2014 15:02:46 -0700 (PDT) In-Reply-To: References: <010e01cf4788$05f3c5a0$11db50e0$@devtemple.com> <01c801cf47c0$59acbf20$0d063d60$@devtemple.com> Date: Sat, 29 Mar 2014 07:02:46 +0900 X-Google-Sender-Auth: lE9vzyBuHJv5sqYEX5ZxaimEVbo Message-ID: To: Andrey Andreev Cc: Julien Pauli , Bill Salak , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a11c3f0200857c704f5b1df1e Subject: Re: [PHP-DEV] [RFC] session_start(), read_only, lazy_write; Take 2 From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c3f0200857c704f5b1df1e Content-Type: text/plain; charset=UTF-8 Hi Andrey, On Fri, Mar 28, 2014 at 7:50 PM, Andrey Andreev wrote: > >> I still don't get it ... the session manager has to call either > >> write() or updateTimestamp() and both of these are part of the session > >> handler. Merging them into one solves the API design and BC issues, I > >> don't see how it breaks any principle. They can still be split to two > >> methods in PHP6, but for the time being, using write() for both > >> purposes IMO solves way more problems than sticking to this design > >> principle you're talking about. > > > > > > Without API, manager cannot manage how it behaves. In general, submodule > > should > > avoid manager state dependency in general. It should have dedicated API > for > > each > > distinct task rather than leaving it to managed by submodule. In > addition, > > manager > > cannot know if save handler supports API or not. If there is API, I can > > display save > > handler capability in phpinfo() page, for example. > > > > If manager expects sub module to behave in some way, it should have > explicit > > API > > for each feature. Otherwise, sub module implementation may differ module > by > > module. > > Defined set of feature is better to have explicit API with modular > design. > > It's not mandatory, > > but the best practice. I don't see reason not to follow the practice > here. > > I agree in general, but you just gave a good reason not to follow that > practice - you can't know if the submodule supports it. Plus, both are > write operations with one of them just writing more data. I'm all for > best practices, but in this case there's a lot of sense not to do > everything by the book. > If there is API, sub module capability can be detected. Writing data and updating time stamp for GC is distinct feature. I don't see good reason not to have API for it. > > > Besides modular design, if write() and updateTimestamp() are merged, flag > > parameter > > for write() should be added. It breaks compatibility with current save > > handlers. I don't > > want BC that could be avoided also. > > No it shouldn't, the decision whether to write or just update the > timestamp is based on an internal flag, or on $session_data. No > additional parameters are required. I removed PS(id) dependency from s_read() with new patch as planned. Why should I introduce new dependency to s_write(), i.e. sub module, that breaks design? It does not make sense. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c3f0200857c704f5b1df1e--