[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings,no error code.]
Markus Fischer wrote: I'm forwarding this to php-dev@ (so people doing filtering don't miss it ;) and let's see what opinion others have about this. - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) -- Yasuo Ohgaki Subject: Bug #12465 Updated: posix_* issuing Warnings, no error code. From: [EMAIL PROTECTED] Date: 28 Feb 2002 22:48:58 - To: [EMAIL PROTECTED] ID: 12465 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Bogus +Status: Open Bug Type: POSIX related Operating System: Linux PHP Version: 4.0.6 New Comment: I agree with Herbert here. It's pretty worthless for the function to generate this verbose error messages during runtime. It's mimic is excatly what the C version does (function-wise). Does the C version do any output itself if it encounters an error (e.g. posix_getpwuid) ? No. Why? Because a NULL return value is a valid return value. It's not a php_error() nor a E_WARNING. Instead, the extension should be re-written to a) return false (the PHP-way), b) store the errno in a thread-global contect variable and c) provide a function to cleanly retrieve the exacty error message (currently, you would habe to catch $php_errmsg (or whatever it was) and parse it out. Short: re-opening ;) Previous Comments: [2002-02-28 14:48:28] [EMAIL PROTECTED] It?s still nonsense to write an error-message! stat() *IS STILL USED* for checking the existence of files. Why do I have to *suppress* error-messages?! PHP should not *generate* them in the first! *If* you choose to implement stat() and name it after the C-function, then stat() should behave as closely as possible like its C-equivalent. [2002-02-04 02:46:54] [EMAIL PROTECTED] It returns false. You need to get rid of error messages with @... [2001-07-30 09:24:17] [EMAIL PROTECTED] hi, I tried to use some of the posix_* functions to work with user-accounts on the system, like posix_getpwnam() and posix_getpwuid(). I expected to get an error-code back (like Failed or FALSE) for pwnames or pwuids which do not exist in /etc/passwd. Instead, PHP will write a warning message in my html-output: : Warning: posix_getpwuid(4711) failed with 'Success' in : /data/home/webmaster/admin/admin.php : on line 197 and, what I think is strange, will fail with ?Success?. Could you please modify the posix_getpw* functions in a way that they 1) do not write strange warning-messages and 2) return a NULL-Value or FALSE, where the unix getpw*(3) will return NULL (just like documented in the man-page) thanks in advance, herbert rosmanith [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]
On Fri, Mar 01, 2002 at 06:59:36PM +0900, Yasuo Ohgaki wrote : Markus Fischer wrote: I'm forwarding this to php-dev (so people doing filtering don't miss it ;) and let's see what opinion others have about this - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) 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 -- Please always Cc to me when replying to me on the lists GnuPG Key: http://gurujosefineat/~mfischer/C2272BD0asc -- PHP Development Mailing List http://wwwphpnet/ To unsubscribe, visit: http://wwwphpnet/unsubphp
[PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings,no error code.]
Markus Fischer wrote: On Fri, Mar 01, 2002 at 06:59:36PM +0900, Yasuo Ohgaki wrote : Markus Fischer wrote: I'm forwarding this to php-dev (so people doing filtering don't miss it ;) and let's see what opinion others have about this - Markus Even if I bogusified(?) it, +1 for return FALSE and set error level to E_NOTICE :) 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 I don't mind removing error messages, too :) -- Yasuo Ohgaki -- PHP Development Mailing List http://wwwphpnet/ To unsubscribe, visit: http://wwwphpnet/unsubphp
Re: [PHP-DEV] Re: [mfischer@php.net: Bug #12465 Updated: posix_* issuing Warnings, no error code.]
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 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php