Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called
| From: | Stanislav Malyshev | Date: | Thu, 22 Jun 2000 22:14:40 +0000 |
| Subject: | Re: PHP 4.0 Bug #5152: Object passed in a session generateserrors when member functions are called | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22009@lists.php.net to get a copy of this message | ||
RL>> And I repeat. My main point here was to maintain a connection between the
RL>> class definition and the object data. That would make it possible to
RL>> autoload them or provide user controlled loading without needing to keep
RL>> track of which file might define which class.
You don't need this connection in session. Moreover, if you upgrade your
class definition, it will break all you scripts by insisting to bring old
class definition from session data instead of a new one. Moreover, you get
thousand and one problem with class hierarchies. Moreover, you bloat the
deserializer to the sky with this by giving it functions that it shouldn't
have - like locating class definitions, error recovery in case it can't,
etc. etc. And this is all for what?
I still think autoloading idea is somewhat interesting, but it should
*not* be whoved itto sessions. If you want it, you just have user-defined
loader function, which will be called *every* time unknown class
definition is encountered. That function would decide which class to load,
if at all. This way the process wil be under user control, it will never
get wrong data and you can by yourself decide if you want this class or
you got it by mistake and really you shoudl just bail out now.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665