SolveConsole/Controllers/DbController.php
public function wizardAction() {
        $this->writeln('DB wizard for a profile');
        $profileName = $this->ask('Enter the <underline>profile name</underline> to edit', 'default');
        $fields = $this->askArray(array(
            'name'  => array('DB name',),
            'user'  => array('DB user', 'root',),
            'pass'  => array('DB password', 'root',),
            'host'  => array('DB host', '127.0.0.1',),
        ));
        if ($this->confirm('Write to file', true)) {
            $config = DC::getDatabaseConfig();
            foreach($fields as $field=>$value) {
                $config->set('profiles/' . $profileName . '/' . $field, $value);
            }
            $config->save();
            $this->notify(ConfigService::getConfigsPath() . 'database.yml', 'saved');
        } else {
            $this->writeln('exiting.');
        }
    }
public function wizardAction() {
        $this->writeln('DB wizard for a profile');
        $profileName = $this->ask('Enter the <underline>profile name</underline> to edit', 'default');
        $fields = $this->askArray(array(
            'name'  => array('DB name',),
            'user'  => array('DB user', 'root',),
            'pass'  => array('DB password', 'root',),
            'host'  => array('DB host', '127.0.0.1',),
        ));
        if ($this->confirm('Write to file', true)) {
            $config = DC::getDatabaseConfig();
            foreach($fields as $field=>$value) {
                $config->set('profiles/' . $profileName . '/' . $field, $value);
            }
            $config->save();
            $this->notify(ConfigService::getConfigsPath() . 'database.yml', 'saved');
        } else {
            $this->writeln('exiting.');
        }
    }
public function wizardAction ( ) { $ this -> writeln ( 'DB wizard for a profile' ) ; $ profileName = $ this -> ask ( 'Enter the <underline>profile name</underline> to edit' , 'default' ) ; $ fields = $ this -> askArray ( array ( 'name' => array ( 'DB name' , ) , 'user' => array ( 'DB user' , 'root' , ) , 'pass' => array ( 'DB password' , 'root' , ) , 'host' => array ( 'DB host' , '127.0.0.1' , ) , ) ) ; if ( $ this -> confirm ( 'Write to file' , true ) ) { $ config = DC :: getDatabaseConfig ( ) ; foreach ( $ fields as $ field => $ value ) { $ config -> set ( 'profiles/' . $ profileName . '/' . $ field , $ value ) ; } $ config -> save ( ) ; $ this -> notify ( ConfigService :: getConfigsPath ( ) . 'database.yml' , 'saved' ) ; } else { $ this -> writeln ( 'exiting.' ) ; } }
Using for generating profile for database
@help Using for generating profile for database
@optional [profile name] to specify profile
Using for generating profile for database