[Postfixadmin-devel] Return value of model/* classes
Brought to you by:
christian_boltz,
gingerdog
From: Christian B. <pos...@cb...> - 2010-12-17 23:16:41
|
Hello, while merging model/UserHander and scripts/models-ext/UserHandler, I noticed that they use very different (and unfortunately incompatible) return values. I took UserHandler->change_pw as an example, but this is most probably an issue that appears at lots of functions inside the model/* classes. The "old" model/UserHandler returns - true on success [1] - false on failure The "new" scripts/models-ext/UserHandler (that I merged to model/UserHandler some minutes ago, r896) returns - 0 on success - 1 on failure Needless to say than true and 0 are the exact opposite :-( The questions are: - Will the XMLRPC interface compatibility break if we switch to 0/1? (you can test this already with current SVN trunk for change_pw ;-) - Will the CLI break if we use true/false? - And finally: Which style is "better"? Which one should we use? Regards, Christian Boltz [1] or if there is no error check, but that's another story ;-) -- In the beginning was the word, and the word was content-type: text/plain |