[dev] Re: [imp] whitelist patch...

Amith Varghese amith at xalan.com
Thu Mar 6 23:53:15 PST 2003


I apologize for being naive, but I don't think this is the right solution.  I'll
explain my reasons why and hopefully someone can tell me I'm wrong :)

> Pass back the general success/failure message in $message, the overall
> success/failure code in $code, and all the extra information you need in
> $userinfo (which addresses failed, which were duplicates, etc.). 

$message is a mixed type (either a string or another PEAR_Error object).  

The problem with a general success/failure message is that it is possible when
adding an address to a blacklist that the address could either exist or not
exist in the blacklist.  If the address is in the list I would like to print

"amith at xalan.com is already in your blacklist"

If the address is not in the list I would like to print

"amith at xalan.com has been added to your blacklist"

So what would be the general success/failure message in this case?  I would like
to pass back both but I can't pass an array here without serializing the array
or imploding it.  I didn't think that was a good idea because I looked through
some of the code and it seems like serialize is only used to put arrays within
sessions or write them to the backend.

The last problem I'm having with this solution is that i want to pass back a
list of addresses that were added successfully and a list that already existed
in the blacklist.  However $userinfo is a string and the only way i can think of
again is to pass information back using serialize()

If using serialize() and unserialize() are ok then there isn't a problem and
this is pretty straightforward.  Regardless of whether I'm way of base or
correct, please let me know :)

Thanks
Amith






More information about the dev mailing list