Skip to content

Instantly share code, notes, and snippets.

@jsolid
Last active December 11, 2015 09:59
Show Gist options
  • Save jsolid/4583773 to your computer and use it in GitHub Desktop.
Save jsolid/4583773 to your computer and use it in GitHub Desktop.
A simple hack to setup database without password
/**
* Step #4: Database
* The validator of this form checks database connection
* and creates the database if it doesn\'t exists
* See lib/validator/dbConnectionValidator.class.php
* File location: siwapp/apps/installer/modules/static/actions/actions.class.php
*
* @param $request
*/
public function executeStep4(sfWebRequest $request)
{
$this->form = new DatabaseConfigurationForm();
if ($request->isMethod('post'))
{
$params = $request->getParameter('db');
$this->form->bind($params);
// CHANGE: Skip form validation to allow empty password (if you setup in XAMPP)
//if($this->form->isValid())
//{
$u = $this->getUser();
$u->setAttribute('database', $params['database']);
$u->setAttribute('username', $params['username']);
$u->setAttribute('password', $params['password']);
$u->setAttribute('host', $params['host']);
$u->setAttribute('step', 5);
$this->redirect($this->next);
//}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment