HM\BackUpWordPress\Mysqldump_Database_Backup_Engine::get_mysql_connection_args PHP Method

get_mysql_connection_args() public method

Get the connection args for the mysqldump command
public get_mysql_connection_args ( ) : string[]
return string[] The array of connection args
    public function get_mysql_connection_args()
    {
        $args = array();
        $args[] = '-u ' . escapeshellarg($this->get_user());
        if ($this->get_password()) {
            $args[] = '-p' . escapeshellarg($this->get_password());
        }
        $args[] = '-h ' . escapeshellarg($this->get_host());
        if ($this->get_port()) {
            $args[] = '-P ' . escapeshellarg($this->get_port());
        }
        if ($this->get_socket()) {
            $args[] = '--protocol=socket -S ' . escapeshellarg($this->get_socket());
        }
        return $args;
    }