Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73470 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70452 invoked from network); 28 Mar 2014 10:50:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2014 10:50:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.213.42 mail-yh0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:56067] helo=mail-yh0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/72-59443-BF355335 for ; Fri, 28 Mar 2014 05:50:36 -0500 Received: by mail-yh0-f42.google.com with SMTP id t59so4860758yho.1 for ; Fri, 28 Mar 2014 03:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=8fcu1jGsQ728i7rQ5A4vDiXj5KaonYD/kC2fDJNB5a4=; b=oi8yU5JvAoOyAopr37fTE5pv3vsCN65wXMVOzUibxPlQ0qsFOy2k8EzhU9Q1EOv71C Viw1yyKC6I2wWH48Rwc+XjtgVJHuVD5Wu7hEhRr5rCit1wQZ4UC4efgKWyX39PXole5y 0IbIKL0cplfd1fQWp+h1PKguwXSn503Rkxwkg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8fcu1jGsQ728i7rQ5A4vDiXj5KaonYD/kC2fDJNB5a4=; b=OUqpvcqlbM8I3N5tiERrSwtPYHXUmclJ8fXGa63RmnnN1sLm6k+yF0i7mPyz+NKZnN qQkyby35Szjz+JjvDaxvRBCUvHH6Nxl1qL1DvBuuH23f3mJl0+3Je8NvrD9cIfEU0aSi a2UynSWvLicy9h3+jxT2fzTG6BEqUswA+ayEgKav2vHsFREr+NazW/0fOyey1P/3mGjA oATPQfavg5llyeUtYdGWtV79hBtrmGjzEUqbcbNYgyWyLYKY4ykKlbU2EzI2I2hpeRRG VUknG6zFwEMG4H7H9IQA3jF6nWIHL1UjJis76J/eoBCQ6W+Rtl+R4vJdOkj6Xfo/Zqts dwOQ== X-Gm-Message-State: ALoCoQl8BNkLoZgVVWzYoMI0iZNqshFboigFECHR7GU/VJZBykSjudG0UU3WUITXFqPky/DfFdgI MIME-Version: 1.0 X-Received: by 10.236.84.227 with SMTP id s63mr10494970yhe.26.1396003833354; Fri, 28 Mar 2014 03:50:33 -0700 (PDT) Received: by 10.170.188.139 with HTTP; Fri, 28 Mar 2014 03:50:33 -0700 (PDT) In-Reply-To: References: <010e01cf4788$05f3c5a0$11db50e0$@devtemple.com> <01c801cf47c0$59acbf20$0d063d60$@devtemple.com> Date: Fri, 28 Mar 2014 12:50:33 +0200 Message-ID: To: Yasuo Ohgaki Cc: Julien Pauli , Bill Salak , "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] session_start(), read_only, lazy_write; Take 2 From: narf@devilix.net (Andrey Andreev) Hi, >> 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. > 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. Cheers, Andrey.