Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73468 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62772 invoked from network); 28 Mar 2014 10:32:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Mar 2014 10:32:28 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.174 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.174 mail-lb0-f174.google.com Received: from [209.85.217.174] ([209.85.217.174:36766] helo=mail-lb0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/B0-59443-ABF45335 for ; Fri, 28 Mar 2014 05:32:26 -0500 Received: by mail-lb0-f174.google.com with SMTP id u14so3511798lbd.5 for ; Fri, 28 Mar 2014 03:32:23 -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=zeL2y2BUOTY+3ocpZKJSCv1vKLuQ3rVOIYQZf+NNpXU=; b=K5x8rL29aSwq0BankDonwFz7C/ARzU8YhzvgpfYVl1jKTZtvJNDVn0AO9N+XsL5PTv l/223SglheW3LyD1tsnmyMHDpN614pEi/9pieYUzH5UPpVCpb3d79RN4Dbsd175hgQoW ShXMMg5TEyA69Pi5Z/9PdrCwxRmhNvTw+dWh99pv4gPDLSBBp3U62meuXCBSRWOmVAbX g1jLET6wL2sWaXzxQDe8z2xhVk01feEiZJmDIvMokirdMmKOH4OsRVOPVgCTR2+fyQv9 cmiBJT8pLbrJFFSzqAgLehBowrUhnUunWV41UgZe7ml4/Av5Wet8FCuVymvfO01ALije NfLw== X-Received: by 10.152.23.9 with SMTP id i9mr76915laf.56.1396002743432; Fri, 28 Mar 2014 03:32:23 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.205.73 with HTTP; Fri, 28 Mar 2014 03:31:43 -0700 (PDT) In-Reply-To: References: <010e01cf4788$05f3c5a0$11db50e0$@devtemple.com> <01c801cf47c0$59acbf20$0d063d60$@devtemple.com> Date: Fri, 28 Mar 2014 19:31:43 +0900 X-Google-Sender-Auth: fhnU179LoyRZcsxK00vpihhTtcQ Message-ID: To: Andrey Andreev Cc: Julien Pauli , Bill Salak , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=089e0160b870a0bb1104f5a8374a Subject: Re: [PHP-DEV] [RFC] session_start(), read_only, lazy_write; Take 2 From: yohgaki@ohgaki.net (Yasuo Ohgaki) --089e0160b870a0bb1104f5a8374a Content-Type: text/plain; charset=UTF-8 Hi Andrey, On Fri, Mar 28, 2014 at 6:46 PM, Andrey Andreev wrote: > > Manager should manage how session behaves, not save handlers. > > It's basic principle of modular design. > > 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. 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. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --089e0160b870a0bb1104f5a8374a--