Re: Re: Silenced include(_once) calls
| From: | bertrand Gugger | Date: | Fri, 03 Mar 2006 10:00:51 +0000 |
| Subject: | Re: Re: Silenced include(_once) calls | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41611@lists.php.net to get a copy of this message | ||
Lukas Smith wrote:
We have talked about this on multiple occations. My opinion is that you can silence errors as long as you handle them accordingly.Good point if archives were working.
Sure but what if the include is expected to fail under certain conditions? Like with optional modules.I don't really understand "optional module" , you mean some functionality switched only by the availability of some class ? The example could be, say I want to build some HTML table, I could check if the package HTML_Table is available then use it else build some rough table directly. In this case, HTML_Table absence is not fatal, so I would need to do it gently. Sure you have better tekno examples. My point is, and if I understood right Alan's one too, such mechanism should be only used when it's really "optional", and not some implementation choice. As Justin's example, Text_Wiki should simply do require_once $parserClass; in this factory, and let PHP die from itself, as here the parser *is* an implementation choice. So, before doing such overload, be sure it's really "optional". Regards -- toggg