I’m working on a project with several database connections.
One of those connections is not critical, it’s a printing server used sporadically and currently in development, this server could fail or not be available.
Is there any way to test the connection and ignore it if it presents an error? and display a message in the views related to it.
Thanks.
P.D the project is built in cake2.x
From Model, you can use:
in this way, the error will appear only if you use this Model. And you can check the connection from the Model in this way:
And you can add in the same way the connection check in the AppController to display the warning if the connection not working by using
$this->Session->setFlash