> Surek Qomi wrote:
>
> Greetings, all.
>
> I have a bit of a problem that I kinna get resolved myself, mainly
> because I don't quite understand /what/ the problem is, nor where it
> is caused.
>
> I'm trying to split the functionality of $body and $user into two
> separate descendancy trees. However, whenever I remove $body as a
> parent of $body, in any way whatsoever, my command input interface
> dies. pop3, smtp and http still works, and I can login, but after
> login none of my input works, though I still receive output (mail
> notifications, etc.)
>
> Does anybody have any suggestions on why this might be occurring? I
> have a sneaking suspicion that it might be connected the command
> parsing system, but I still don't understand all the technicalities
> involved with that either, so for the moment, I'm stumped.
There is a lot of stuff on $body. An easier way to approach this would
be to do something similar to the following:
* Rename $body to something. I'll use $proto_user
for this email.
* Rename all references to $body to $proto_user
everywhere in the core. $proto_user.init_body()
and $proto_user.uninit_body() will need to be
renamed if they are present.
* Test to be sure it still works.
* Once everything works with that done, let's make
a list of what is defined on $proto_user. Separate
that list into things to move to $body and things
to leave on $proto_user. For this example, we
shall move everything related to the body_parts stuff
to $body.
* Create $body. Add a $proto_user,body variable. Do
the work to have it get initialized correctly in
$proto_user.init_proto_user() and
$proto_user.uninit_proto_user().
* Create the variables on $body that you will need.
* Make sure that all references to those variables in
methods on $proto_user are using a method to access
the variables and not directly accessing them.
* Modify the accessor methods for the variables being
moved to load from body.body_parts() or whatever.
* Test that everything is using the variables on $body
now. Delete the variables on $proto_user.
* Copy the methods involved over to $body. On $proto_user,
forward them to the $body object, but when doing so,
use the stack() function to tell you via .debug()
that something is calling the method from $proto_user
rather than from the body. Modify all callers.
* Once everything is calling the methods correctly and
things have been tested, it should be safe to delete
the forwarding methods from $proto_user. I would
be inclined to leave them in there for some time
though and to file a bug to ensure their removal in
the future once things have been fully tested.
Good luck!
- Bruce
|