Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80998 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74892 invoked from network); 22 Jan 2015 22:39:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jan 2015 22:39:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.50 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.192.50 mail-qg0-f50.google.com Received: from [209.85.192.50] ([209.85.192.50:39523] helo=mail-qg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/D2-61273-E1C71C45 for ; Thu, 22 Jan 2015 17:39:27 -0500 Received: by mail-qg0-f50.google.com with SMTP id f51so3626043qge.9 for ; Thu, 22 Jan 2015 14:39:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:content-type; bh=7ATmrG8bWMKcDNZ8b3lSxWoHjzlQluDM+Ln0OlL3jIA=; b=Tmk1s0FAwkMkmWpnk3zjO+bWARHVfcK29TseUBgygEKbf+V2obEIP4M/hXwAsc4NQN 2v0Uma2BpbtSaXFHwozh59rS297wRy7K31vkaniYTyLTf+lQxP5ewpHZl9sjMJ6waitZ 3lHWOO+/gDtfrrs/whHO6FpMFjL7WpppGOQU4BGHQyxTozW1Y4gIWRBj0A9eBsttJ4C4 jpW+rCvnIL7wfH9yhDFZAU8H4H8Jwm4iAFkgFG00E96UoGDTxWYXhSKerEsalLKc+u8Q 7m5vJdcB49fVDE58uik2HLs/m5P04DfaokN2BUO4Heu3ffTF+JgMKmrS4xvPt/KoLHir 4Amg== X-Received: by 10.224.111.194 with SMTP id t2mr2684299qap.86.1421966363178; Thu, 22 Jan 2015 14:39:23 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Thu, 22 Jan 2015 14:38:43 -0800 (PST) Date: Fri, 23 Jan 2015 07:38:43 +0900 X-Google-Sender-Auth: b38Y1P3m-QQ9ENIccNLfVhEAepk Message-ID: To: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b604582f5bfa0050d45577a Subject: Removing base class from session handler From: yohgaki@ohgaki.net (Yasuo Ohgaki) --047d7b604582f5bfa0050d45577a Content-Type: text/plain; charset=UTF-8 Hi all, I would like to propose removal of SessionHandler object. PHP7 is perfect opportunity. Session module uses "previous save handler" as it's base class of SessionHandler object. e.g. ini_set('session.save_handler','files); $handler = new SessionHandler; // files save handler functions are used as base class. I guess original intention was to extend C written save handlers. However, this feature is unusable unless user script has access to PS(mod_data). PS(mod_data) is initialized by following data structures. files handler (mod_files.c) -------------------------------------------------------------------- typedef struct { char *lastkey; char *basedir; size_t basedir_len; size_t dirdepth; size_t st_size; int filemode; int fd; } ps_files; ps_module ps_mod_files = { PS_MOD_SID(files) }; -------------------------------------------------------------------- mm handler (mod_mm.c) -------------------------------------------------------------------- typedef struct ps_sd { struct ps_sd *next; php_uint32 hv; /* hash value of key */ time_t ctime; /* time of last change */ void *data; size_t datalen; /* amount of valid data */ size_t alloclen; /* amount of allocated memory for data */ char key[1]; /* inline key */ } ps_sd; typedef struct { MM *mm; ps_sd **hash; php_uint32 hash_max; php_uint32 hash_cnt; pid_t owner; } ps_mm; -------------------------------------------------------------------- Note: PS(mod_data) is void pointer and save handler use it to store whatever data required for the handler. All handlers have different structures. User script must have access the struct(PS(mod_data)) to extend base class. However, user script does not have access to internal C struct, obviously. PS(mod_data) differs handler by handler, so it is not feasible to provide uniform access API. In conclusion, SessionHandler object has no real use except as a toy and makes session module complex unnecessary. Since it cannot have real use, nobody is using it. Therefore, I would like to remove it. Any comments? Regards, P.S. I would like to discuss Session Handler Interface cleanup also. I'll create new thread for it later. -- Yasuo Ohgaki yohgaki@ohgaki.net --047d7b604582f5bfa0050d45577a--