日期:2014-05-17 浏览次数:20439 次
$dir=opendir(ROOT_PATH."frame/hack");
while($file=readdir($dir)){
if(is_file(ROOT_PATH."frame/hack/$file/data.sql")){
$sql=readover(ROOT_PATH."frame/hack/$file/data.sql");
preg_match_all("/INSERT INTO `qb_hack`([^']+)\('([^']+)', '([^']+)'/is",$sql,$array);
$_array = @include(ROOT_PATH."frame/hack/$file/fix.php");
if($_array[setup]==2){
$_array[input]=" checked onclick='return false' ";
}elseif($_array[setup]==1){
$_array[input]=' checked ';
}
$Harray[$file]=array(
'name'=>implode(',',$array[3]),
'input'=>$_array[input],
);
}
}
//读取与写入
function readover($filename,$method="rb"){
if($handle=@fopen($filename,$method)){
flock($handle,LOCK_SH);
$filedata=fread($handle,filesize($filename));
fclose($handle);
}
return $filedata;
}
function writeover($filename,$data,$method="rb+",$iflock=1){
touch($filename);
$handle=fopen($filename,$method);
if($iflock){
flock($handle,LOCK_EX);
}
$show=fputs($handle,$data);
if($method=="rb+") ftruncate($handle,strlen($data));
fclose($handle);
return $show;
}