百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>Ecshop教程> ecshop校验文件生成MD5文件代码
分享文章到:

ecshop校验文件生成MD5文件代码

发布时间:12/03 来源: 浏览: 关键词:

 ecshop校验文件生成MD5文件的代码

  1. define('ROOT_PATH', str_replace(basename( __FILE__), '', str_replace('\\', '/', __FILE__))); 
  2.  
  3. ini_set('max_execution_time', '300'); 
  4.  
  5. checkfiles('./', '\.php', 0); 
  6. checkfiles('admin/', '\.php|\.htm|\.js|\.css|\xml'); 
  7. checkfiles('api/', '\.php'); 
  8. checkfiles('includes/', '\.php|\.html|\.js',1,'fckeditor');    //fck不检查 
  9. checkfiles('js/', '\.js|\.css'); 
  10. checkfiles('languages/', '\.php'); 
  11. checkfiles('plugins/', '\.php'); 
  12. checkfiles('wap/', '\.php|\.wml'); 
  13. /* 
  14. checkfiles('themes/default/', '\.dwt|\.lbi|\.css');   //模板 
  15. checkfiles('uc_client/', '\.php', 0); 
  16. checkfiles('uc_client/control/', '\.php'); 
  17. checkfiles('uc_client/model/', '\.php'); 
  18. checkfiles('uc_client/lib/', '\.php'); 
  19. */ 
  20.  
  21. file_put_contents('./admin/ecshopfiles.md5',$md5str);   //保存文件校验信息 
  22.  
  23. echo "MD5文件生成完成"; 
  24.  
  25.  
  26.  
  27.  
  28. /**检查文件 
  29. * @param  string $currentdir    //待检查目录 
  30. * @param  string $ext           //待检查的文件类型 
  31. * @param  int    $sub           //是否检查子目录 
  32. * @param  string $skip          //不检查的目录或文件 
  33. */ 
  34. function checkfiles($currentdir, $ext = '', $sub = 1, $skip = '') 
  35.     global $md5data, $md5str; 
  36.     $dir = @opendir(ROOT_PATH.$currentdir); 
  37.     $exts = '/('.$ext.')$/i'; 
  38.     $skips = explode(',', $skip); 
  39.  
  40.     while($entry = @readdir($dir)) 
  41.     { 
  42.         $file = $currentdir.$entry; 
  43.         if($entry != '.' && $entry != '..' && $entry != '.svn' && (preg_match($exts, $entry) || $sub && is_dir($file)) && !in_array($entry, $skips)) 
  44.         { 
  45.             if($sub && is_dir($file)) 
  46.             { 
  47.                 checkfiles($file.'/', $ext, $sub, $skip); 
  48.             } 
  49.             else 
  50.             { 
  51.                 if($file != './md5.php') 
  52.                 { 
  53.                     $md5data[$file] = md5_file($file); 
  54.                     $md5str .= md5_file($file).' *'.$file."\r\n"; 
  55.                 } 
  56.             } 
  57.  
  58.         } 
  59.  
  60.     } 
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

相关文章

共有6人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板