library/Garp/Cli/Command/Db.php
public function connect() {
        $adapter = Zend_Db_Table::getDefaultAdapter();
        if (!$adapter) {
            Garp_Cli::errorOut('No database adapter found');
            return false;
        }
        $config = $adapter->getConfig();
        $params = array(
            '-u' . escapeshellarg($config['username']),
            '-p' . escapeshellarg($config['password']),
            '-h' . escapeshellarg($config['host']),
            ' ' . escapeshellarg($config['dbname'])
        );
        $cmd = 'mysql ' . implode(' ', $params);
        $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes);
        $proc_status = proc_get_status($process);
        $exit_code = proc_close($process);
        return ($proc_status["running"] ? $exit_code : $proc_status["exitcode"] ) == 0;
    }
public function connect() {
        $adapter = Zend_Db_Table::getDefaultAdapter();
        if (!$adapter) {
            Garp_Cli::errorOut('No database adapter found');
            return false;
        }
        $config = $adapter->getConfig();
        $params = array(
            '-u' . escapeshellarg($config['username']),
            '-p' . escapeshellarg($config['password']),
            '-h' . escapeshellarg($config['host']),
            ' ' . escapeshellarg($config['dbname'])
        );
        $cmd = 'mysql ' . implode(' ', $params);
        $process = proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes);
        $proc_status = proc_get_status($process);
        $exit_code = proc_close($process);
        return ($proc_status["running"] ? $exit_code : $proc_status["exitcode"] ) == 0;
    }
public function connect ( ) { $ adapter = Zend_Db_Table :: getDefaultAdapter ( ) ; if ( ! $ adapter ) { Garp_Cli :: errorOut ( 'No database adapter found' ) ; return false ; } $ config = $ adapter -> getConfig ( ) ; $ params = array ( '-u' . escapeshellarg ( $ config [ 'username' ] ) , '-p' . escapeshellarg ( $ config [ 'password' ] ) , '-h' . escapeshellarg ( $ config [ 'host' ] ) , ' ' . escapeshellarg ( $ config [ 'dbname' ] ) ) ; $ cmd = 'mysql ' . implode ( ' ' , $ params ) ; $ process = proc_open ( $ cmd , array ( 0 => STDIN , 1 => STDOUT , 2 => STDERR ) , $ pipes ) ; $ proc_status = proc_get_status ( $ process ) ; $ exit_code = proc_close ( $ process ) ; return ( $ proc_status [ "running" ] ? $ exit_code : $ proc_status [ "exitcode" ] ) == 0 ; }
Start the interactive mysql client

@return bool
Start the interactive mysql client