Skip to content

Commit

Permalink
Merge branch 'main' of github.com:ronnorthrip/dbpull
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/Commands/DBPull.php
  • Loading branch information
ronnorthrip committed Dec 1, 2023
2 parents c0bed6e + fdfeb66 commit 73e0606
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Commands/DBPull.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ public function handle()
$this->info('Database connection on remote server worked.');
} else {
$this->error('Database connection on remote server failed.');

return self::FAILURE;
}

return self::SUCCESS;
}
$full_dump = $this->option('full-dump');
Expand Down Expand Up @@ -363,18 +365,21 @@ public function ssh_get_tables()
public function ssh_ping()
{
exec("ssh $this->remote_ssh 'whoami'", $result);

return implode("\n", $result) !== '';
}

public function ssh_ping_mysql()
{
exec("ssh $this->remote_ssh '$this->remote_mysql_auth_echo | mysql --defaults-file=/dev/stdin -B -h $this->remote_mysql_host -P $this->remote_mysql_port $this->remote_mysql_database --disable-column-names -e \"SHOW TABLES\" '", $result);

return implode("\n", $result) !== '';
}

public function ssh_count_migrations()
{
exec("ssh $this->remote_ssh 'ls -1 $this->remote_migrations_path | wc -l'", $result);

return 1 * implode('', $result);
}

Expand Down

0 comments on commit 73e0606

Please sign in to comment.