如何在 PhpStorm 项目中包含软件

How to include software in PhpStorm project

我刚开始使用 PhpStorm。在我的项目中,我收到了很多未定义的变量错误,因为我正在为 vBulletin 创建一个插件。

我想知道有没有办法在我的插件开发中包含我正在使用的主要软件,以避免出现未定义的变量和函数? WordPress 插件开发的工作原理。

例如,我有我的项目文件夹:c://wamp/www/projects/projectname/,我在 c://wamp/www/vb3/

中有 vBulletin

我希望能够告诉 PhpStorm“嘿,这个项目的核心脚本在这里”。

正如 LazyOne 所说,我能够使用包含路径实现此目的。

Include paths are used for holding third-party code that is used for completion and reference resolution in some functions/methods that use file paths as arguments, for example, require() or include().

Note that the files added via include paths are not meant to be edited within the scope of your project. If you have the existing code that you need to access and modify from within several projects, consider adding it via an additional content root.

  1. 执行以下操作之一:

    • 配置当前项目的包含路径,在 Settings/Preferences 对话框 Ctrl+Alt+S,点击 Languages & 下的 PHP 框架。

    • 配置将应用于所有新的包含路径 创建的项目,使用默认的新项目设置(文件|新建 项目设置 |新项目的设置)。

  2. 在打开的 PHP 页面上,在包含路径选项卡上配置包含路径列表:

    • 使用添加和删除来添加和删除路径。

    • 使用上移和下移对列表中的项目重新排序。

    • 单击“按字母顺序排序”按钮可按字母顺序对路径进行升序排序。