feat(yeswiki-move): return config file
Some checks failed
/ test (push) Has been cancelled

This commit is contained in:
Florian Schmitt 2024-12-06 10:04:16 +03:00
parent 2336c2a00e
commit b8788b4c96
2 changed files with 4 additions and 3 deletions

View file

@ -13,7 +13,8 @@ function domainIsOnServer($domain)
function wikiIsOnServer($path) function wikiIsOnServer($path)
{ {
return glob('/home/*/'.$path.'/wakka.config.php'); $configFile = glob('/home/*/'.$path.'/wakka.config.php')[0] ?? false;
return $configFile;
} }
function checkIP($domain, $withWww = false, $noip6 = false) function checkIP($domain, $withWww = false, $noip6 = false)

View file

@ -60,7 +60,7 @@ if (!domainIsOnServer($fromDomainWithoutWww)) {
$climate->error('ERROR : Domain '.$fromUrl['host'].' was not found on the server.'."\n"); $climate->error('ERROR : Domain '.$fromUrl['host'].' was not found on the server.'."\n");
exit; exit;
} }
if (!wikiIsOnServer($fromDomainWithoutWww.($fromUrl['path'] ?? ''))) { if (!$fromWiki = wikiIsOnServer($fromDomainWithoutWww.($fromUrl['path'] ?? ''))) {
$climate->error('ERROR : no Yeswiki found '.$fromDomainWithoutWww.$fromUrl['path'].' on the server.'."\n"); $climate->error('ERROR : no Yeswiki found '.$fromDomainWithoutWww.$fromUrl['path'].' on the server.'."\n");
exit; exit;
} }
@ -76,7 +76,7 @@ if (!domainIsOnServer($toDomainWithoutWww)) {
$climate->error('ERROR : Domain '.$toUrl['host'].' was not found on the server.'."\n"); $climate->error('ERROR : Domain '.$toUrl['host'].' was not found on the server.'."\n");
exit; exit;
} }
if (!wikiIsOnServer($toDomainWithoutWww.($toUrl['path'] ?? ''))) { if (!$toWiki = wikiIsOnServer($toDomainWithoutWww.($toUrl['path'] ?? ''))) {
$climate->error('ERROR : no Yeswiki found '.$toDomainWithoutWww.$toUrl['path'].' on the server.'."\n"); $climate->error('ERROR : no Yeswiki found '.$toDomainWithoutWww.$toUrl['path'].' on the server.'."\n");
exit; exit;
} }