dongli8862 2012-12-05 12:22
浏览 24
已采纳

脚本循环遍历html / php / js文件以构建已使用资源的列表

As some of my websites have progressed, the server has become cluttered with files no longer in use be it due to versioning, jquery plugins no longer being used, etc...

I'm thinking about writing a script using grep with some regex but if theres already something that exists, it would make things easier.

Can someone point me in the right direction of a script / program that I can feed a listing of html / php / js files that could loop through them, reading the code and tell me what .php, .js, .jpg, etc... files are included?

The script could look at src='', include(), require(), etc...

I'm not looking for someone to do it for me; just a starting point on how to proceed or if something already exists.

  • 写回答

2条回答 默认 最新

  • drtoclr046994545 2012-12-05 12:54
    关注

    for images, scripts etc you can use firebug for firefox (just click the net tag)

    In php you could use "var_dump( get_included_files() )" (at the end of your code) to get all included files for that particular page.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验
  • ¥15 ue5 .3之前好好的现在只要是激活关卡就会崩溃
  • ¥50 MATLAB实现圆柱体容器内球形颗粒堆积
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件