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
yohg...@ohgaki.net

Reply via email to