分类分类
更新时间:2026-03-29 00:48:00作者:fang
ecshop校验文件生成MD5文件的代码
define('ROOT_PATH', str_replace(basename( __FILE__), '', str_replace('', '/', __FILE__)));
ini_set('max_execution_time', '300');
checkfiles('./', '.php', 0);
checkfiles('admin/', '.php|.htm|.js|.css|xml');
checkfiles('api/', '.php');
checkfiles('includes/', '.php|.html|.js',1,'fckeditor'); //fck不检查
checkfiles('js/', '.js|.css');
checkfiles('languages/', '.php');
checkfiles('plugins/', '.php');
checkfiles('wap/', '.php|.wml');
/*
checkfiles('themes/default/', '.dwt|.lbi|.css'); //模板
checkfiles('uc_client/', '.php', 0);
checkfiles('uc_client/control/', '.php');
checkfiles('uc_client/model/', '.php');
checkfiles('uc_client/lib/', '.php');
*/
file_put_contents('./admin/ecshopfiles.md5',$md5str); //保存文件校验信息
echo "MD5文件生成完成";
/**检查文件
* @param string $currentdir //待检查目录
* @param string $ext //待检查的文件类型
* @param int $sub //是否检查子目录
* @param string $skip //不检查的目录或文件
*/
function checkfiles($currentdir, $ext = '', $sub = 1, $skip = '')
{
global $md5data, $md5str;
$dir = @opendir(ROOT_PATH.$currentdir);
$exts = '/('.$ext.')$/i';
$skips = explode(',', $skip);
while($entry = @readdir($dir))
{
$file = $currentdir.$entry;
if($entry != '.' && $entry != '..' && $entry != '.svn' && (preg_match($exts, $entry) || $sub && is_dir($file)) && !in_array($entry, $skips))
{
if($sub && is_dir($file))
{
checkfiles($file.'/', $ext, $sub, $skip);
}
else
{
if($file != './md5.php')
{
$md5data[$file] = md5_file($file);
$md5str .= md5_file($file).' *'.$file."rn";
}
}
}
}
}
相关
王道三国策略游戏380.18 MBv0.0.12026-03-28
下载刮个爽手机版休闲益智186.96 MBv1.0.282026-03-28
下载龙符天祭策略游戏756.03 Mv22026-03-28
下载入魂一番赏app网上购物106.66 Mv4.3.52026-03-28
下载童话师经营养成504.02 Mv1.1.52026-03-28
下载Bebo Cam app图像拍照264.51 Mv2.3.02026-03-28
下载纯三国官方正版策略游戏167.24 Mv0.0.12026-03-28
下载Poka Cam app图像拍照74.7 Mv1.8.02026-03-28
下载COLMO app趣味娱乐199.15 Mv2.3.5.22026-03-28
下载愤怒的小鸟变形金刚苹果版休闲游戏439.4 Mv2.39.02026-03-28
下载这也能切苹果版休闲游戏479.6 Mv21342026-03-28
下载口袋吉伊卡哇苹果手机版模拟游戏920.4 Mv2.0.02026-03-28
下载










