Please help ...
It is necessary to change the file line by line, the content of which is approximately the following:
<?php if(!defined('CMS')) { die('Отказано в доступе!');} $CFG = array(); $_CFG['SITENAME']='бла бла'; $_CFG['HOMETITLE']='бла бла'; $_CFG['HOMECOM']=''; $_CFG['SITEOFF']=0; $_CFG['DEBUG']=0; $_CFG['OFFTEXT']='Производится обновление сайта'; $_CFG['KEYWORDS']='бла бла'; $_CFG['METADESC']='бла бла'; $_CFG['SEOURL']=''; $_CFG['LANG']='ru'; $_CFG['SITEMAIL']='admin@sait.ru'; $_CFG['TEMPLATE']='tpl'; $_CFG['TOMEZONA']='Asia/Irkutsk'; $_CFG['TIMEDIFF']=''; $_CFG['ALLOW_IP']=''; ?>
I tried the following code, but it crumbles the whole file to horror
$f_arr = file($dir. "/includes/config.php"); $f_arr[2] ='$_CFG[\'SITENAME\']=\''.$sitename.'\';'; print_r( $f_arr); $f = fopen($dir. "/includes/config.php" , "w" ); for( $i = 0; $i < count( $f_arr ); $i++ ) { fwrite( $f , $f_arr[$i]."\n"); }
Adding "left" spaces, tried $ f_arr [2]. = "\ N" and from
fwrite ($ f, $ f_arr [$ i]. "\ n");
remove
"\ n"
but there is something better, but you still need to have the file as originally, and only one line has changed and nothing else can be rearranged or raped. If there is a good man, I will be very grateful to him, it's just like a trifle, but my head hurts on him.