Compare commits

..

No commits in common. "2e83f4025d885471c3c57ed09ef850ea752181b1" and "02372fe9888c13992101ec5ef2b48c0425bc6224" have entirely different histories.

2 changed files with 2 additions and 35 deletions

View file

@ -6,12 +6,6 @@ use Amp\Future;
use Amp\Http\Client\HttpClientBuilder;
use Amp\Http\Client\Request;
function domainIsOnServer($domain)
{
$domainWithoutWww = preg_replace('/^www\./m', '', $domain);
return file_exists('/etc/nginx/conf.d/'.$domainWithoutWww.'.conf');
}
function checkIP($domain, $withWww = false, $noip6 = false)
{
if (!preg_match('/(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)/', strtolower($domain))) {
@ -389,7 +383,7 @@ function addExtensions()
function addStatistics()
{
// requete SQL
// INSERT INTO `matomo_site` (`idsite`, `name`, `main_url`, `ts_created`, `ecommerce`, `sitesearch`, `sitesearch_keyword_parameters`, `sitesearch_category_parameters`, `timezone`, `currency`, `exclude_unknown_urls`, `excluded_ips`, `excluded_parameters`, `excluded_user_agents`, `excluded_referrers`, `group`, `type`, `keep_url_fragment`, `creator_login`) VALUES (NULL, 'Partage ton outil', 'https://partagetonoutil.fr', '2023-02-01 00:00:00', '0', '1', '', '', 'Europe/Paris', 'EUR', '0', '', '', '', '', '', 'website', '0', 'superadmin');
// INSERT INTO `matomo_site` (`idsite`, `name`, `main_url`, `ts_created`, `ecommerce`, `sitesearch`, `sitesearch_keyword_parameters`, `sitesearch_category_parameters`, `timezone`, `currency`, `exclude_unknown_urls`, `excluded_ips`, `excluded_parameters`, `excluded_user_agents`, `excluded_referrers`, `group`, `type`, `keep_url_fragment`, `creator_login`) VALUES (NULL, 'Partage ton outil', 'https://partagetonoutil.fr', '2023-02-01 00:00:00', '0', '1', '', '', 'Europe/Paris', 'EUR', '0', '', '', '', '', '', 'website', '0', 'superadmin');
}

View file

@ -49,35 +49,8 @@ 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 replaced'."\n");
$climate->out('This will move yeswiki on <bold>'.$from.'</bold> to <bold>'.$to.'</bold>, CAREFULL the destination yeswiki will be rreplaced'."\n");
$input = $climate->confirm('Is it all good ?');
if ($input->confirmed()) {
$climate->shout(