This documentation will guide you through how to configure your application for automatic database configuration
After installing application on the server, there could be some changes to database server, login creadentials, etc which leads in break down of your application. Configuring automatic task of CakePHP-App-Installer plugin will let you re-configure your application whenever there is a failure
It will check for whether database connection could be established or not. Failure can be due to following reasons
- change in database host
- change in password of user
- change in user of the database
- deletion of user from database
- deletion of database from server
- accidental modification to database configuration file of application
Your application may break down and couldn't be loaded giving a 505 error
Plugin will autocheck for database configuration and let you re-configure database in case of database connectivity failure.
Add following lines to your beforeRender
function of AppController.php
$this->loadComponent('CakePHPAppInstaller.Install');
if ($this->request->params['plugin'] !== 'CakePHPAppInstaller') {
$this->Install->installationCheck();
}
Your beforeRender
function then looks like
public function beforeRender(Event $event)
{
$this->loadComponent('CakePHPAppInstaller.Install');
if ($this->request->params['plugin'] !== 'CakePHPAppInstaller') {
$this->CakePHPAppInstaller->installationCheck();
}
...
...
...
}
That's it Now whenever there is database connectivity failure, you will be asked to reconfigure your application.