>> Thanks for your additions. Looking forward for more.....:-) >> I tried to incorporate them, also the contributions from the other people. >> Have a look online http://www.holliwell.de/draft/draft1 >> or download at http://www.holliwell.de/draft/draft1.tar.gz (about 4kb) >> Keep in mind it`s a draft and just an attempt to gather the ideas and >> contributions :-). Feel free to comment, change and so on ....
> I think it is just time to heat up the discussion about this. > Some additions I can think of: > --- > Error handling: die is not right for production, but a complex if > is not needed, either one can use a user defined error function, > or more easily can use trigger_error(), or user_error(), which > adds much more options and possibilities than using die, and > is completely appropriate to use in production: > $conn = mysql_connect(...) or user_error("Cannot connect", E_USER_ERROR); > This will cause the script to stop running, and to print out a > PHP style error message by default. But php.ini can be set up > to redirect this to syslog, or use a special error handling function. > IMHO use this way of error handling in examples. Why we use it, > should be explained in the "error handling" and/or "about the manual" > parts. > --- > Sample outputs: <para> in exmaple is not allowed, so the screen example > in your draft wont work with docbook. Need to invent some other > type of output. > --- > It would be nice to hear what others think about this draft, as we can > only make things standards after proper discussion, but it would be nice > to have a standard in a short term. +1 for trigger_error(); -1 for user_error: alias for trigger_error syslog seems always a bit suspicious to me. Depending on the webserver configuration, that user may have insufficient rights to write into?? On win detailed tuning of user-rights maybe neceessary (ok, you talked about production sites, but there maybe also some sites running on w2k or winnt :-) ) $conn = mysql_connect(...) or user_error("Cannot connect", E_USER_ERROR); lacks flexibility, not in error_handling but the in the or construct. Philip Olson dropped a note about this in a recent mail. Therefore my suggestion: $conn = mysql_connect(...); if !("whatever...."); doSomething(); echo 'output stuff'; trigger_error("Cannot connect", E_USER_ERROR); (Sample output: not as familiar to docbook as you are. Therefore i just copied this from array.xml; first example with screen.. Btw. there are many differrent ways used with this <sreen> thing.) 0ne comment to strings and variables and output with echo: echo $string, "blabla", .....; maybe an alternative? Friedhelm