引入 PHPdoc 以包含 CakePHP .ctp 文件
我正在使用 PHPdocumentor 记录我的 CakePHP 应用程序。您可能知道,在 CakePHP 约定之后,视图包含在 .ctp 文件中(例如 app/views/addresses/index.ctp),这些文件基本上是普通的 PHP 文件,只是文件扩展名发生了变化。 PHPdocumentor 只识别 .php 文件,我在配置文件中找不到让它知道 .ctp 文件的选项。这部分最接近我想要的:
;; comma-separated list of files to parse
;; legal values: paths separated by commas
;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory
但它似乎不接受像 *.php
这样的通配符,而且我真的不想将我的 50 个视图文件的列表写入此配置文件(除非有更好的解决方案)。 是否有可能在全局范围内配置 phpdoc 以包含 .ctp 文件,或者我是否必须在 phpdoc 源代码中的某处稍微修改一下它?
I'm documenting my CakePHP app using PHPdocumentor. As you might know, after CakePHP convention, the views are contained in .ctp files (e.g. app/views/addresses/index.ctp), which are basically normal PHP files just with a changed file extension. PHPdocumentor only recognizes .php files, and I cannot find an option in the config file to let it know of the .ctp files. THis section come closest to what I want:
;; comma-separated list of files to parse
;; legal values: paths separated by commas
;filename = /path/to/file1,/path/to/file2,fileincurrentdirectory
But as it seems it doesn't acceppt wildcards like *.php
, and I really don't want to write a list of my 50 view files into this config file (unless there's a better solution).
Is there a possibility to configurate phpdoc globally to include .ctp files or do I have to change this in a somewhat hackish was somewhere in the phpdoc source?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该更新 phpDocumentor.ini 文件的 [_phpDocumentor_phpfile_exts] 部分,以包含您希望 phpDocumentor 解析的任何其他文件扩展名。
You should update the [_phpDocumentor_phpfile_exts] section of your phpDocumentor.ini file to include any additional file extensions that you want phpDocumentor to parse.
注释说的是路径;与文件名无关。也许尝试在其中添加
views
目录的路径,但如果它正在寻找*.php
文件,那么我认为这不会有多大作用。The comment says paths; nothing about file names. Maybe try adding the path to your
views
directory in the there, but if it is looking for*.php
files then I don't think that will do much good.