File: /var/www/www-root/data/www/wowik.click/tds/replace_out.php
<?php
@ini_set('display_errors', 1);
@error_reporting(-1);
$old = 'hotbcalene.cc';//старый домен
$new = 'hotbxufuxu.today';//новый домен
$folder_ini = 'ini';//название папки с *.ini
$old = htmlentities($old, ENT_QUOTES, 'UTF-8');
$new = htmlentities($new, ENT_QUOTES, 'UTF-8');
if(file_exists(__DIR__."/$folder_ini")){
$arr_ini = array();
$files = scandir(__DIR__."/$folder_ini");
foreach($files as $v){
$v = trim($v);
if(preg_match("~^(.+?\.ini)$~", $v)){
$arr_ini[] = $v;
}
}
foreach($arr_ini as $ini){
$g_data = unserialize(file_get_contents(__DIR__."/$folder_ini/$ini"));
$s = 1;
while(!empty($g_data[$s])){
if(!empty($g_data[$s]['s_out']) && strstr($g_data[$s]['s_out'], $old)){
$g_data[$s]['s_out'] = str_replace($old, $new, $g_data[$s]['s_out']);
$g_data[$s]['s_out_lm'] = strtotime('now');
}
if(!empty($g_data[$s]['out_bot']) && strstr($g_data[$s]['out_bot'], $old)){
$g_data[$s]['out_bot'] = str_replace($old, $new, $g_data[$s]['out_bot']);
}
$s++;
}
$g_data = serialize($g_data);
file_put_contents(__DIR__."/$folder_ini/$ini", $g_data, LOCK_EX);
}
echo 'ok';
exit();
}
?>