Re: Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]

From: Date: Fri, 01 Mar 2002 14:03:02 +0000
Subject: Re: Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]
References: 1 2 3  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9545@lists.php.net to get a copy of this message
At 11:15 01.03.2002, you wrote:
    My point was to remove the (not needed) php_error() calls
    completely and save the message(errorcode) in a variable so
    the user (developer) can decide himself if he wants to do
    something with the message or not.
    php_error() call's are, verbosely spoken, pain in the ass to
    catch ($php_errmsg global var?? no thanks). It would overal
    make more sense for this module to don't do any error output
    itself but provide a error string fetch function or so.
+1 Having posix_errno() which returns the error of the last message and posix_strerror() which returns the description should be the way to go. In addition it is consistent with the rest of posix functions. Edin
From my point of view the best way would be to have a new function, say php_debug(file,message,type) #define PHP_DEBUG(message) php_debug(__FILE__,message,E_DEBUG) and present debug only for cvs versions or the user can decide wether or not e.g. the programmer. With the old php_error() i would appreciate a switch to mentioned posix mechanism. But we would need a global .h file to keep track of all error messages. Or better we need a registration mechanism to generate the codes for the exception numbers. Perhaps this could be expanded by an exception 'class'. to be precise a struct to hold number __FILE__ message and so forth. Then we could have a very nice fetch/catch mechanism. +1 marcus
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.cvs (#9545) next »