You can try adding a beforefilter() function in yout app_controller.
Put some logic in there that checks if a db connection is alive and
redirect to the error page if the db is dead.

On Dec 17, 7:12 pm, RichardAtHome <[EMAIL PROTECTED]> wrote:
> > It's called 'write code that actually checks for errors'.  This is an
> > issue for any application, and I cannot think of any framework that
> > automatically gives you that kind of functionality.  What you call
> > 'automatic' is the result of a forward-thinking developer who made a
> > commitment to proper error handling.
>
> Yup, true. But, how *would* you configure cake to redirect to a site
> down page if the database connection failed?
>
> Some code in bootstrap.php that checks for a connection and then
> redirect to pages/site_down for example?
>
> On Dec 17, 3:41 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
>
> > On Dec 17, 2007 10:28 AM, squidliberty <[EMAIL PROTECTED]> wrote:
>
> > > I have on occasion had problems with my hosting during which MySQL is
> > > not accessible. The result is that CakePHP renders a malformed page
> > > and (if Debug is in use) throws a number of errors (such as "Too many
> > > connections"). In this sort of situation, some CMS (eg. Joomla!) will
> > > automatically throw up a "This site is down" page. Can anyone tell me
> > > how this might be done with CakePHP? I assume that there is some way
> > > to check for a proper database connection and generate an error
> > > message if one cannot be established. Any advice appreciated!
>
> > It's called 'write code that actually checks for errors'.  This is an
> > issue for any application, and I cannot think of any framework that
> > automatically gives you that kind of functionality.  What you call
> > 'automatic' is the result of a forward-thinking developer who made a
> > commitment to proper error handling.
>
> > --
> > Chris Hartjes
>
> > My motto for 2007:  "Just build it, damnit!"
>
> > @TheKeyboard -http://www.littlehart.net/atthekeyboard
--~--~---------~--~----~------------~-------~--~----~
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