简体   繁体   English

如何在PhpDoc docblock中使用NetBeans和SVN @version标记?

[英]How do I use NetBeans and SVN @version tag in the PhpDoc docblock?

I use NetBeans as my php ide and I have seen @version tags in the docblock that look like this: 我使用NetBeans作为我的php ide,我在docblock中看到了@version标签,如下所示:

@version $Id someinfo and timestamp

Does NetBeans have a way to automatically update this with each commit? NetBeans是否有办法在每次提交时自动更新? Or am I missing the point entirely of this tag? 或者我完全忽略了这个标签的观点?

Well, no, Netbeans does not have a way. 好吧,不,Netbeans没办法。 But subversion does... 但是颠覆确实......

The exact tag is $Id$ , and it corresponds to the svn property svn:keywords=Id . 确切的标签是$Id$ ,它对应于svn属性svn:keywords=Id Find the config file (On linux, it's usually under ~/.subversion/config . On windows I found it under ~\\Application Data\\Subversion\\Config . Find that file (or create it if it doesn't exist) and then add these lines: 找到配置文件(在Linux上,它通常在~/.subversion/config 。在Windows上我发现它在~\\Application Data\\Subversion\\Config 。找到该文件(或者如果它不存在则创建它)然后添加这些线:

[miscellany]
enable-auto-props = yes

[auto-props]
*.php = svn:keywords=Id

If you want to set the End Of Line type to LF ( \\n ), you can simply replace that last line with this: 如果要将End Of Line类型设置为LF( \\n ),则可以使用以下代码替换最后一行:

*.php = svn:keywords=Id;svn:eol-style=LF

this worked for me: 这对我有用:

go to your source folder and execute this: 转到源文件夹并执行以下命令:

find . \( -name '.svn' -prune \) -o -name '*.php' -exec svn propset svn:keywords "Id " {} \;

this manually sets the keyword for each file 这会手动设置每个文件的关键字

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM