Re: [RFC][VOTE] User defined session serializer
| From: | Yasuo Ohgaki | Date: | Thu, 08 Dec 2016 05:09:22 +0000 |
| Subject: | Re: [RFC][VOTE] User defined session serializer | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-97338@lists.php.net to get a copy of this message | ||
On Thu, Dec 8, 2016 at 10:02 AM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote:
> Please note that users cannot write clean/efficient user defined
> serializer without this RFC.
It may be better to explain real working code.
Since I added "php_serialize" to recent PHP, user defined
serialization with current API became a lot simpler, but you'll see
this hack is inefficient. i.e. There are needless serializations as
well as needless handler calls.
https://gist.github.com/yohgaki/432579e535ae97856a1227e4d47d0e2e
Efficient and clean code by this RFC is written as comment below.
In addition, it works both OO and procedural API.
Note: Since 7.0, updateTimeStamp feature does not work with OO API.
This will result in a lot slower session performance for session
database over network. i.e. Memcached/Redis/session_pgsql/etc. This is
a bug though. I'll fix this by new OO API.
http://lxr.php.net/xref/PHP-7.1/ext/session/tests/bug71162.phpt
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net