Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73070 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 1745 invoked from network); 11 Mar 2014 23:54:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Mar 2014 23:54:25 -0000 Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.213.46 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.213.46 mail-yh0-f46.google.com Received: from [209.85.213.46] ([209.85.213.46:37757] helo=mail-yh0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B8/02-22021-032AF135 for ; Tue, 11 Mar 2014 18:54:25 -0500 Received: by mail-yh0-f46.google.com with SMTP id b6so6469409yha.33 for ; Tue, 11 Mar 2014 16:54:21 -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=3bMRevvvakMXFrGQDYNNiCdDO4b1SUsH4TaiScpGhHU=; b=ZiGODIlyf3QS/Ykf0vhu9xCJmhegLqHZM+EZgS07kcdah4bj06BV/jkYwqAGT0qXPO wnj/KDD8qspxVtfU5eLM97OTd9kia8zj3kM5gRl5vfoNOPvXJZkqXaYrqPYM4xKSvekp nS+gQ2zuhtAf1ac5XBivCRYTgDTHHE2A81Pq8= 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=3bMRevvvakMXFrGQDYNNiCdDO4b1SUsH4TaiScpGhHU=; b=UCzDb/RCtJGRcuwKlHsvVKpFZATd2F/C1NssATweRxSID3ckslTm73PqprC3I8HG3p QA5bWVAQQH8pEv9OVf/Zy65h10yx8rk+O+LnTOcSUKUYxvW+a9S1BXDjUj3fFqt48wGk aLjRCmUuhNOlLK+9d5i5Bu+Z9q4Cqq+/dmVE8a49aiNc1XpBfwF+FwPOa86bsAN1C/eF vSybb4Di+r0nu2xTq5ccyZk/AXLaDH+7EuEga32WqySt3PlKCeuxFpE4OdtFfr5nZ48C n3XVejYEckiunJb9gOkZwejYMkuLCm0wBryuNbHW33Op68N31ZjNM8r4vu9pE9CkVJ2H AcaQ== X-Gm-Message-State: ALoCoQkQi0Jr5tmgtTJ2SswSA5sx821jvQpEC1s6b/LUeXHFLOSSXUePeuJNqigvmazH3kI2PITK MIME-Version: 1.0 X-Received: by 10.236.184.136 with SMTP id s8mr590072yhm.132.1394582061704; Tue, 11 Mar 2014 16:54:21 -0700 (PDT) Received: by 10.170.188.139 with HTTP; Tue, 11 Mar 2014 16:54:21 -0700 (PDT) In-Reply-To: References: Date: Wed, 12 Mar 2014 01:54:21 +0200 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: Revert session_serializer_name(), session_gc() From: narf@devilix.net (Andrey Andreev) Hi Yasuo, On Wed, Mar 12, 2014 at 12:37 AM, Yasuo Ohgaki wrote: > Hi Andrey, > > On Tue, Mar 11, 2014 at 10:37 PM, Andrey Andreev wrote: >> >> I just saw this in the 5.6-alpha1 changelog: >> >> - Implemented Request #54649 (Create session_serializer_name()). >> (Yasuo) >> ... >> - Implemented Request #11100 (session_gc() function). (Yasuo) >> >> >> I didn't find an RFC and I don't know a way to search for a discussion >> on internals (Google doesn't find one). >> >> session_serializer_name(): https://bugs.php.net/bug.php?id=54649 >> >> I don't think that this should've been implemented, especially with >> the reasoning from the feature request ... The same could be applied >> to all session ini options and especially now since session_start() >> accepts them, it's useless IMO. >> >> session_gc() was added in a similar fashion: >> https://bugs.php.net/bug.php?id=11100 >> >> There's already a comment about how the same thing can be achieved by >> overloading SessionHandler::gc(), but a user could also just alter >> session.gc_divisor, session.gc_probability to ensure that the garbage >> collector is started. > > > Users want to have contorl *when* gc is performed rather than luck. This is > reasonable. IMO. I like control, it's nice and *I already have it*: ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 1); >> >> And while session_serializer_name() is just redundant, session_gc() >> could cause performance issues. > > There is session_module_name(), why not session_serializer_name()? Why not session_cookie_lifetime()? Why not session_cache_limiter()? Why not session_entropy_file()? etc. "Why not" is never a good argument in programming and really, when is the last time that you've seen something accepted here on internals because of "why not"? I'd rather question if session_module_name() is useful, or any function that's an alias for ini_set('something', ...). > Many 3rd party save handler implements many serializer. I haven't seen many. In fact, I've seen none. > session_gc() is nothing to do with performance. Users may abuse. The same > argument applies to gc probability. The problem is, users WILL abuse and that's bad. Think of what the manual page would say about that function. Something in the lines of: Calls the session garbage collector, ignoring session.gc_probablity and session.gc_divisor. What does that say to an inexperienced and even to the intermediate user, who doesn't even know what GC is? "Hey, this collects garbage! It's nice to clean things up, I should always call it!" Yet another bad practice spreads. Sure, that *could* apply to gc_probability, gc_divisor, but those are *necessary* options and they are not easy to find unless you are specifically looking for them. > >> I'd strongly suggest that these 2 functions should be removed before >> PHP 5.6 is officially released. > > > These are simple additional APIs. > If your argument applies, there should be number of new RFCs. Actually, if my argument applies - both feature requests should've been ignored. Lots of people make "this would be nice" feature requests without having the knowledge and experience to know if it would really be "nice". That's why there's a bunch of smart people here to take the decisions for them, collectively. I myself have been forced to write an RFC for a smaller and less impactful change, but that's not the point. Both of these functions should've at least been discussed here on internals. And finally, do you assume that there's demand for these features? session_gc() specifically was requested 13 YEARS ago and it didn't even get a "+1" comment in that timeframe. There are people on this list who'd question user demand even if people are tweeting about the feature with fingers crossed that it would be implemented ... these are two that hardly anybody cares about. Cheers, Andrey.