Hi Mariano,

Just to wrap things up (I hope):

On Nov 30, 10:52 am, "Mariano Iglesias" <[EMAIL PROTECTED]>
wrote:
> include('app_error.php');
>
> on your base controller. That should be a require_once() per CakePHP coding
> practices (if you bake the Cake way, then go all the way.)
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).

> Also is this because Cake is not including your app_error.php? Any reason why?
Bear in mind that you are looking at an example taken from a plugin,
and there is definitely no "if this file exists include it" logic for a
plugin appError class. To my knowledge there is no automatic appError
inclusion (see
https://trac.cakephp.org/browser/branches/1.1.x.x/cake/libs/object.php?rev=3206#L155),
I could be wrong of course, but maybe there shouldn't be anyway as it
would be one more redundant check for the majority of installs that
don't have or need this file/class.

BTW the code in my AppError class is basically the same as the
ErrorHandler class - in most cases I am just changing the path to the
error view file.

Cheers, HTH,

AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :)
You may get your answer quicker by asking on the IRC Channel (you can
access it with just a browser here: http://irc.cakephp.org).


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

Reply via email to