~
Advanced Hosters -

m_Stasuk
: 23.12.2007
: 5967
Contest (: 2)
# : 14, 2011 10:57 pm


:

<?
$work_dir="./";         
// -
// "/"
$excl_dir=array();
$excl_dir[0]="./no_work_here/";         
$excl_dir[1]="./and_here/and_here/";
// , / -
// "/"
$file_mask_1=".html?quot;;   
$file_mask_2=".js";
// ( ,
// )
$search_str="test";    #
$replace_str="TEST";    #
//******************************************************
$level=0;
function sr($dir)
{
global $level,$file_mask_1,$file_mask_2,$search_str,$replace_str,$excl_dir;
echo "<b>";
for ($i=0;$i<$level;$i++) echo "* * ";
echo $dir."</b>";
if (@in_array($dir,$excl_dir))
{
echo " - needn't search & replace<br>";
return;
}
echo "<br>";
$p = dir($dir);
while($ent=$p->read())
{
if ($ent!="." && $ent!=".." && !is_dir($dir . $ent) && (eregi(sql_regcase($file_mask_1),$ent) || eregi(sql_regcase($file_mask_2),$ent)))
{
[email protected]($dir.$ent);
[email protected]("",$tmp);
if (strpos("@!#%xrenoder^&*()".$str,$search_str))
{
for ($i=0;$i<($level)+1;$i++) echo "* * ";
echo $dir.$ent." found...";
$str=str_replace($search_str,$replace_str,$str);
if ([email protected]($dir.$ent, "w"))
{
flock($fp,LOCK_EX);     
fwrite($fp,$str);
fclose($fp);
echo " and replace<br>";
}
else echo " and <b>can't replace</b><br>";
}
}
elseif($ent!="." and $ent!=".." and is_dir($dir . $ent))
{
$level++;
sr($dir.$ent."/");
$level--;
}
}
$p->close();
return;
}
sr($work_dir);
echo "SEARCH & REPLACE Complete";
?>



, . , , ,

* * * * ./2010-02-19-247582/aktery-filma-lyubov-v-bolshom-gorode.php found... and can't replace
* * * * ./2010-02-19-247582/aktery-filma-lyubov-v-bolshom-gorode-2.php found... and can't replace
* * * * ./2010-02-19-247582/aktery-filma-lyubov-v-bolshom-gorode-3.php found... and can't replace
* * * * ./2010-02-19-247582/aktery-filma-lyubov-v-bolshom-gorode-1.php found... and can't replace

? - ?

--

deBrain
V.I.P.
: 03.06.2010
: 1569
# : 14, 2011 11:17 pm
?

: DigitalOcean

phillosof
: 11.01.2009
: 1632
# : 14, 2011 11:22 pm
deBrain ():
?



777, , htaccess error reporting.

m_Stasuk
: 23.12.2007
: 5967
Contest (: 2)
# : 14, 2011 11:37 pm
644. , , Smile))

--

m_Stasuk
: 23.12.2007
: 5967
Contest (: 2)
# : 15, 2011 12:16 am
,

--
    ~