[sork] Patch for vacation forwards-driver (.forward-parser)

Chuck Hagenbuch chuck at horde.org
Tue Apr 20 14:34:23 PDT 2004


Quoting Espen Jürgensen <espen at hhkol.dk>:

> Here is an update to the dot forward parser for the Vacation module.

Thanks! I've committed this; it looks okay to me (did some minor CS cleanup),
but I'd very much appreciate backup testing on this since this isn't 
one of the
apps I know best.

> However, there are some problems related to the way _getUserDetails
> exits, and these problems affect the parser. Currently, it seems like it
> is difficult to trigger an error. Even ftp errors do not get shown. I
> believe the problem is related to the structure of the driver, where
> _getUserDetails gets called twice. But I haven't examined these issues
> thoroughly, since they are outside the scope of this patch.

If $this->_details is set, then it'll just be returned, so you can set it to
false or an empty array or what have you.

> I wouldn't mind a bit of advice on how to exit from _getUserDetails,
> however. Particularly, I would like to know how to exit, when parsing
> fails, but contents of .vacation.msg can be read. Returning false, and
> saving the contents in $this->_details seems like the obvious solution,
> but it doesn't work (because the second time getUserDetails gets called,
> the return value is only determined by $this->_details). I see two easy
> solutions:
>
> 1) Just ignore .vacation.msg and set $this->_details = false

No.

> 2) Add something like $this->_details['unparsable'] = true, and make
> _getUserDetails return false when it is set.

Something along these lines sounds better to me.

-chuck

--
"Regard my poor demoralized mule!" - Juan Valdez


More information about the sork mailing list