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: Chris Weiss
Subject: Re: [Phpgroupware-developers] Discussion: include/require stateme nts
Date: Wed, 11 May 2005 07:56:08 -0500

On 5/11/05, Kai Hofmann <address@hidden> wrote:
> 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:

header.inc.php should only be included in the index.php, from there
the menuaction GET var loads the app.

 0) (and most likely) the header.inc.php and phpgw_config table have
wrong paths.
> 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.

you missed the part about nice errors looking profesional?  

> 
> 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.

this would be ideal :)

> 
> Greetings
> 
>    PowerStat
> 
>




reply via email to

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