Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73078 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31707 invoked from network); 12 Mar 2014 11:04:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Mar 2014 11:04:08 -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.160.178 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:58916] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6C/92-17005-62F30235 for ; Wed, 12 Mar 2014 06:04:08 -0500 Received: by mail-yk0-f178.google.com with SMTP id 79so26535758ykr.9 for ; Wed, 12 Mar 2014 04:04:04 -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=IpoSK1Sk3g+6+F5m5N1RiN2c4IMd7G8N177NsqHTa7k=; b=O8+SQPxL2rRYHh/LLqXOcJ118JO/Jbwd0Qnopc/A/gTdkGGoZ3xTUEmrAe2dvPJ4fM IM58upVjaF1IQv4OBaPFlI1zaXo/yWa6fVONmaYG2RePGVTPDtPjEt5cUHzc+JWejzQE xgf/6e94YRkjQkDwh258KSFD+ewFMwBltUREg= 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=IpoSK1Sk3g+6+F5m5N1RiN2c4IMd7G8N177NsqHTa7k=; b=aPm8Q5QfG/xtU6VBjwcqTSS7r5XYoqYsW61XAo5VYL+nGF4PjRXPCmXZhmQZlL+Wn5 hZ2q87qs+YjgU+nqSfXMXFhIQByuOBisGp5Qj1X8qiFZc/jYlkHvV6N7hAn4s+7vUfgF EaBRU6xIxzz/spjwbqFhr5UQnDQ2l367Tka08hee/xfZ3wo86dp7HFyyCrxhwjAQP2Dp 6secy8NIIkM7wSJ9EloA8DpeoSkUILqXwU07Am+aGWtHA0X1llVF1vntMkdD5YFHVM6n PmIkrYZYgNrwDFAarJsgyed7S+4tPjFsED7filiM72SNKzgBJINDzmiKlrxlztTb7+E+ t4WA== X-Gm-Message-State: ALoCoQlNexJ0d1e83czW7i0x3czOjiCqvLAfxSDsL0SCj0pXwvrQUQ8zg2l2aHi2JRz1r2hy0ARF MIME-Version: 1.0 X-Received: by 10.236.170.137 with SMTP id p9mr3041627yhl.105.1394622243903; Wed, 12 Mar 2014 04:04:03 -0700 (PDT) Received: by 10.170.188.139 with HTTP; Wed, 12 Mar 2014 04:04:03 -0700 (PDT) In-Reply-To: References: Date: Wed, 12 Mar 2014 13:04:03 +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, On Wed, Mar 12, 2014 at 2:19 AM, Yasuo Ohgaki wrote: > Hi Andrey, > > On Wed, Mar 12, 2014 at 8:54 AM, Andrey Andreev wrote: >> >> > 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); > > > Of course you can. > It does not look nice as API. API should have good name for it. IMO. > > session_gc() is useful for both low traffic site and high traffic site. > I don't see reason not to have explicit gc API. User may simply call > > session_gc(); > > periodically by cron, etc. There's a very good reason not to have it, you just ignored most of my previous email which explained exactly that. >> >> 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. > > > Those aren't changed by programs often. Oh, trust me - cookie lifetime is changed way more often than the serializer. And how do you define often anyway? Sessions are something that are setup once, it's rarely the case that a programmer needs to change any of the session INI settings more than once in the same program. > As I wrote, 3rd party save handler implements their own serializers. > Not like above example, it is likely called with session_module_name(). e.g. > > session_module_name('memcache'); > session_serializer_name('igbinary'); It's your opinion that this is "likely" done that way. I for one have *never* used session_module_name(). And again, this is not something that people would write more often than once in the whole application. > It looks better than > > session_module_name('memcached'); > ini_set('session.serializer_handler', 'igbinary'); It doesn't look better than: ini_set('session.save_handler', 'memcached'); ini_set('session.serialize_handler', 'igbinary'); IMO, this is more explicit and more understandable for people who haven't read the manuals for the "custom" functions. > It's reasonable to have session_serializer_name(), since it would be used > with session_module_name(). API should have good name here, too. I'm again questioning whether session_module_name() is useful/necessary in the first place. > We may discuss what we should do with module functions that modify it's INI. > There are number of them already. I think you need RFC for this. On this, I agree. > My opinion is "There should be API with obvious name, if it is used often or > mandatory". On this - not. ;) Cheers, Andrey.