Re: Revert session_serializer_name(), session_gc()
| From: | Yasuo Ohgaki | Date: | Wed, 12 Mar 2014 00:19:14 +0000 |
| Subject: | Re: Revert session_serializer_name(), session_gc() | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-73071@lists.php.net to get a copy of this message | ||
Hi Andrey,
On Wed, Mar 12, 2014 at 8:54 AM, Andrey Andreev <narf@devilix.net> 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.
> >>
> >> 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.
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 looks better than
session_module_name('memcached');
ini_set('session.serializer_handler', 'igbinary');
It's reasonable to have session_serializer_name(), since it would be used
with session_module_name(). API should have good name here, too.
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.
My opinion is "There should be API with obvious name, if it is used often
or mandatory".
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net