diff --git a/src/Apps/MySQLApp.php b/src/Apps/MySQLApp.php new file mode 100644 index 0000000..7d873b0 --- /dev/null +++ b/src/Apps/MySQLApp.php @@ -0,0 +1,57 @@ +escapeShellArg($this->connection_info['mysql_host']), + '-P ' . $this->escapeShellArg($this->connection_info['mysql_port']), + '-u ' . $this->escapeShellArg($this->connection_info['mysql_username']), + '-p' . $this->escapeShellArg($this->connection_info['mysql_password']), + $this->connection_info['mysql_database'], + ]); + + $process = proc_open( + $cmd, + [ + 0 => STDIN, + 1 => STDOUT, + 2 => STDERR, + ], + $pipes + ); + proc_close($process); + } + + /** + * Validates the app can be used + */ + public function validate() { + if ($this->isWindows()) { + return FALSE; + } + + $this->app_location = 'mysql'; + return $this->which($this->app_location); + } +}