This commit is contained in:
parent
45ea6abffb
commit
2e83f4025d
1 changed files with 28 additions and 1 deletions
|
@ -49,8 +49,35 @@ if (empty($from) || $from == 'https://example.com' || empty($to) || $to == 'http
|
|||
exit;
|
||||
}
|
||||
|
||||
if (!filter_var($from, FILTER_VALIDATE_URL)) {
|
||||
$climate->error('ERROR : the source url given with --from '.$from.' is not a valid url.'."\n");
|
||||
exit;
|
||||
}
|
||||
$fromUrl = parse_url($from);
|
||||
var_dump($fromUrl);
|
||||
if (!domainIsOnServer($fromUrl['host'])) {
|
||||
$climate->error('ERROR : Domain '.$fromUrl['host'].' was not found on the server.'."\n");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!filter_var($to, FILTER_VALIDATE_URL)) {
|
||||
$climate->error('ERROR : the destination url given with --to '.$to.' is not a valid url.'."\n");
|
||||
exit;
|
||||
}
|
||||
$toUrl = parse_url($to);
|
||||
var_dump($toUrl);
|
||||
if (!domainIsOnServer($toUrl['host'])) {
|
||||
$climate->error('ERROR : Domain '.$toUrl['host'].' was not found on the server.'."\n");
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($from === $to) {
|
||||
$climate->error('ERROR : --from and --to parameters must be different.'."\n");
|
||||
exit;
|
||||
}
|
||||
|
||||
$climate->bold()->underline()->out('Move a YesWiki');
|
||||
$climate->out('This will move yeswiki on <bold>'.$from.'</bold> to <bold>'.$to.'</bold>, CAREFULL the destination yeswiki will be rreplaced'."\n");
|
||||
$climate->out('This will move yeswiki on <bold>'.$from.'</bold> to <bold>'.$to.'</bold>, CAREFULL the destination yeswiki will be replaced'."\n");
|
||||
$input = $climate->confirm('Is it all good ?');
|
||||
if ($input->confirmed()) {
|
||||
$climate->shout(
|
||||
|
|
Loading…
Reference in a new issue