我现有的文件缺少版权信息。我想使用 Phpstorm / 其他 JetBrains IDE 将许可证头添加到项目中的多个文件中。
此页面没有帮助:https ://www.jetbrains.com/idea/help/topicId609815.html
请问有人知道流程吗?
我现有的文件缺少版权信息。我想使用 Phpstorm / 其他 JetBrains IDE 将许可证头添加到项目中的多个文件中。
此页面没有帮助:https ://www.jetbrains.com/idea/help/topicId609815.html
请问有人知道流程吗?
2016 年,JetBrains 专门为此目的添加了版权工具。
有关更多信息,请参阅https://blog.jetbrains.com/phpstorm/2016/01/managing-copyright-notices-in-phpstorm/。
I have the same requirement, but the closest thing I could get is to use the Live Templates feature. Basically I added a new Template under the PHP Group with the abbreviation copyright and the following text
/**************************************************************************
* Copyright (C) $user$, Inc - All Rights Reserved
*
* <omitted copyright blah>
*
* @file $file$
* @author $user$
* @site <my website>
* @date $date$
*/
Unfortunately it seems impossible to use Template Variables such as ${NAME} in the context of a Live Template, so you are forced to stick with the provided expressions. In this case I used fileName(), user() and date() which were enough for my case.
Finally you can type copyright and press Tab to generate the header.