phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Phpgroupware-developers] Discussion: include/require stateme nts


From: Kai Hofmann
Subject: RE: [Phpgroupware-developers] Discussion: include/require stateme nts
Date: Wed, 11 May 2005 14:33:11 +0200

> "some files seem to be missing or some path is set wrong, please check
> your configuration"

Sure thats ok, bute lets go to a concrete case:

Inclusion of "header.inc.php":

The groupware checks first if the header is there if not it
goes to the setup code.

So the check has been done and using require_once() is no problem at all,
will avoid double inclusion (because header is included nearly everywhere).
And when a require will fail, this could only mean two things:

1) The path in a file is wrong - so development error
2) The file has been deleted during runtime (after the setup check) by
   cross site scripting or something like that.

In both cases having a native php error is no problem at all, because
something really bad has happended.

Last but not least I think using require_once along with set_error_handler

see http://de.php.net/set_error_handler (works since php 4.0)

is the best solution, because you have an central error handler that can
output error messages and no additional code for every(!) require statement.

Greetings

   PowerStat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]