douyi1939 2014-11-19 19:36
浏览 32

解析php脚本以用于文档目的

I've not been able to find any inexpensive tools to document all the vars/consts/functs/classes/includes in a PHP script, so I'm writing my own. (I use a lot of open source scripts that need to be modified. Plus, it would be nice to have a directory for my own projects.)

I've kludged one together using php string functions, finding all the constants, then traversing each line of the script, loading the line number in an array, then the includes/requires, then the variables, etc. This gets about 90% of what I want. If I were to improve it, though, I would probably have change the approach to dealing with the script character by character, just like the php compiler probably does. Anyone have a better idea how to solve this problem? I can't believe I have to invent this wheel...

I suppose there are programming environments that have this functionality built in, but I'm old school and low budget. And, yes, OO and tight functions eliminate the need to document most vars, but there is still need to see the include/require tree, document globals, see where all the instances of a class are used and how., etc.

  • 写回答

2条回答 默认 最新

  • duanfu7840 2014-11-20 02:22
    关注

    The following tools are highly recommended to generate HTML documentation for your project, just pick one of them:

    You can also customize the HTML output if you need, or pick a template made by the community.

    评论

报告相同问题?

悬赏问题

  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器