When talking about require_once() I was referring to CakePHP programming
guidelines: "always use require_once() to include files." I understand your
point however about the possibility of the file not being there. On which
case, following those practices, one could change it to:
if (file_exists('file.php'))
{
require_once('file.php');
}
Also if we are worried about require_once() being slower than including()
that means that performance is a critical issue on your application, if so
loading a class to handle an error, plus loading all of cake's required
classes to process the error, seems like a lot of overhead. Meaning:
performance should not be that big of an issue when using require_once
instead of include. ;)
Anyway, penny for thought.
Good call the feature request.
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de AD7six
Enviado el: Jueves, 30 de Noviembre de 2006 07:40 a.m.
Para: Cake PHP
Asunto: Re: Catching DB connection failure
Not sure of your reason for that:
if the file isn't present, I don't want processing to halt - it's not
critical to the plugin's functionality.
_once calls are slower, and there is no circumstance whereby it would
be included more than once.
Even if it was included more than once, there would be no problem as
the class is wrapped in an "if class does'nt already exist" if
statement (to cater for the possibility that a user already has an
AppError class, although that logic might need to be revised at some
point in the future: https://trac.cakephp.org/ticket/1399).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---