NetBeans“上次修改时间:”模板
希望是一个简单的问题。
我已开始将 NetBeans 用于我正在开发的新的多开发人员 PHP 项目。我过去在脚本中注意到的一件事是 PHPDoc 顶部的一个部分,其内容类似于是否
/**
* PDO Database Configuration
* Last Updated: %Date: 15/03/2011, 22:31:04 GMT (Tue 15th Mar 2011)%
*
* @author lethalMango
...
*/
有一种方法可以让“最后更新:”部分在保存时自动更新?
干杯
Hopefully a simple question.
I've started using NetBeans for a new multi-developer PHP project I am working on. One thing I have noticed in scripts in the past is a section in the PHPDoc at the top with something similar to
/**
* PDO Database Configuration
* Last Updated: %Date: 15/03/2011, 22:31:04 GMT (Tue 15th Mar 2011)%
*
* @author lethalMango
...
*/
Is there a method to get that "Last Updated:" section to update automatically on save?
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Melv 所说,一种常见的做法是通过版本控制系统。这是比依赖 IDE 更好的方法,因为它只需要在服务器端设置一次,而不是在每个客户端上设置。
如果您使用的是 Subversion,则可以使用 属性。
像这样,假设
yourfile.php
已添加到 svn:然后将字符串
$LastChangedDate$
添加到文件中,每次提交文件时关键字都会扩展到包括日期。As Melv says, a common way of doing is via the version control system. This is a better approach than relying on the IDE since it only needs setting up once server-side rather than on every client.
If you're using Subversion, you'd do this with properties.
Something like this, assuming
yourfile.php
has been added to svn:Then add the string
$LastChangedDate$
to the file, and every time the file is committed the keyword will be expanded to include the date.我很确定 Netbeans 不会给你这样的东西。我也不知道有哪个插件可以为您提供钩子,但是肯定有一些方法可以在版本控制提交和/或构建工具中执行此类操作,因此这可能是解决它的最佳方法。
I'm pretty sure Netbeans doesn't give you anything like that. I don't know of a plugin that gives you a hook to it either, but there are definitely ways of doing this sort of thing on versioning commits and/or in build tools, so that might be the best way to tackle it.