Re: Whups Links (Patch)
Chuck Hagenbuch <[email protected]>
| Newsgroups | gmane.comp.horde.devel,gmane.comp.horde.whups |
|---|---|
| Message-ID | <[email protected]> |
Quoting [email protected]: > The following patch implements linking from whups (into Turba!). There is > no linking into whups yet. Overall, *nice*! I have this working well and the possiblities are pretty fun to imagine. :) It's committed. The minor CODING_STANDARDS lessons for the day are: Function declaractions follow the "one true brace" convention: function fooFunction($arg1, $arg2 = '') { if (condition) { statement; } return $val; } (from [4] Function Definitions) ... and: ------------------- [22] Error checking =================== Horde code should use PEAR_Error objects to return most error conditions from library calls, and many times we will simply pass back a PEAR_Error object generated by an underlying library (such as Mail or PEAR DB). For these cases, use the following style of code block to check for success after any call which could generate an error condition: $result = $something->call('may error'); if (is_a($result, 'PEAR_Error')) { // Handle error condition. } else { // Succeeded. } Note that is_a() checks for subclasses of the named class, as well, so if the object you get back is really a DB_Error object, this will still catch it (since DB_Error extends PEAR_Error). Again, good stuff overall - thanks! -chuck -- Charles Hagenbuch, <[email protected]> I know there's fish out there, but where g-d only knows. -- Horde developers mailing list Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [email protected]