| bertrand Gugger 2005-10-31, 7:56 am |
| re
Helgi Žormar wrote:
>On Mon, 31 Oct 2005 13:53:52 +0100, bertrand Gugger wrote:
>
>
>
>
>Maybe I have to introduce people to file_exists ?
>People should always use file_exists when they are doing some kind of a
>driver approach and the driver might not be there (MDB2 and its drivers is
>one good example, it handles that nicely)
>
>Think we should rather focus on that kind of way rather than having some
>obscure error reporting magic :)
>
>- Helgi
>
>
>
yes, the first example is surely a bad one
(even if you can find it a couple of occurences in pear)
Some packages we well know uses the safer mechanism you quote
And I think, no care if it's a little loose in performance,
those optional includes are made only once, if well designed :)
That was an example only,
the second one is more possible as php doesn't offer a way to see if a
session was started
(or I missed it, certainly)
I want to propose that @ get forbidden,
the wiser the ways, the better it is.
(especially if it focuses on the right positive aspect and not doing it
by some error trapping)
Now, I forgot to mention the other way to silence the errors, the way
pear installer uses,
*
set_error_handler*( )
A @ is limited to the silenced expression,*
set_error_handler*() applies to the whole,
what can be very painfull if ill used.
I think several related problems were trapped in the installer, but I'm
still unsure.
*set_error_handler*() should perhaps be wrapped in a global pear control...
a+
--
bertrand "toggg" Gugger
|