Re: [Phplib-users] php4 session fix, and some thoughts
Brought to you by:
nhruby,
richardarcher
From: Lindsay H. <fmo...@fm...> - 2003-01-23 18:58:25
|
Thus spake Maxim Derkachev on Thu, Jan 23, 2003 at 03:28:36AM CST > Hello, Lindsay, > > I did not promise that Session4* classes will be 100% compatible with > the Session3 (I call it so). $sess->in is to be deprecated in the Session4, > just because it is not possible to make it work the right way. $sess->in is less a problem, in my view, than the behavior of auto_init. I don't reference $sess->in in any of my applications, but I make good use of auto_init and depend on its published behavior as supported through page.inc or page4.inc. > That's why the API change. I suppose we should not bloat the code and/or > mess with the global scope to solve the problem. It would be better just > to change the documented auto_init behavior for the Session4. Given the nature of php4 session management, I guess that any data that's going to be session oriented has to be global, but IMHO, doing whatever's necessary to preserve auto_init is worth it, and if the global variable is named something unique, then it's effectively private and shouldn't be a problem. The flag for it is only one byte! Hardly "bloat", although the overhead involved in making the flag unique and accessable will be a bit more. The very name of the feature, "auto_init", implies that it's a session initialization feature. If it's not to be supported, then we might as well put code in a page constructor method and be done with it and drop the auto_init/setup.inc feature altogether. IMHO, having a hook to a once-per-session function which we can set in applications space is highly useful and logical, and was wisely included by Kristian et al. If it's not supported in the ongoing phplib API, then I and everyone else who has a setup.inc which we depend on will get our applications broken and have to deal with it. If you go this way, I'm going to have to keep patches on hand to restore the expected behavior of auto_init, since I have several sites here that depend on it, as do others, I'm sure. I implore you to make the relatively small sacrifice in code and storage overhead required to at _least_ maintain the expected auto_init behavior, even if the $sess->in hook is depreciated and goes away. > So, I consider > it a documentation problem, that should be solved. That's the very least of it!! It's not even beta code until it's properly documented. There are a lot of people out here that use phplib as a tool on sites that people pay to have properly maintained by us. If we don't have the tools to work with, or the tools change so as to break rather than fix things, and we don't know about it, then we're in a pretty tough spot. > Of course, You can not be sure that everything will work with the Session4 > as it used to work with the Session3. Say, You might register > something like $some_object->some_property with the Session3, while it > simply won't work in the Session4 case, somebody could rely on > Session3 serialize() data format, while it has nothing in common > with the PHP4 session serialization format, and so on. As I said before, the first responsibility of the API is to the user application space, and keeping it consistent across upgrades in the underlying code has to be a primary objective of the developers. There are some things that will have to change, of course, however it's important to minimize the impact by preserving the API in as much as it's possible to do so. Supporting the expected behavior of auto_init is very doable and needs to be done. The code and storage cost is minimal. Phplib isn't just experimental code for the developers to enjoy playing with (although I would guess that you do :-) There are people out here in the trenches using it for customer websites who depend on it for a living. Ciao, -- Lindsay Haisley | "Everything works | PGP public key FMP Computer Services | if you let it" | available at 512-259-1190 | (The Roadie) | <http://www.fmp.com/pubkeys> http://www.fmp.com | | |