微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在IntelliJ IDEA中配置Laravel项目结构?

我应该将哪些文件标记为“源/资源/排除”?

enter image description here

解决方法:

我自己的逻辑基于the PHPStorm guide

资料来源

The root folder

推理:您的源代码可以位于根目录下的mutliple文件夹中.

替代方法:只需标记您在应用程序,引导程序,配置,路由中包含代码的真实文件夹,即可(更多…)

Click this button to mark the selected folder as the root for
namespaces used in your project. Based on this setting, PHPStorm
suggests you the proper folder name when you want to create a new
namespace under another parent namespace during creation or moving a
PHP class, that is, when you are actually creating or moving a PHP
class to a non-existing namespace under another parent namespace. If
no Sources folder is specified, you will have to type the proper
folder manually.

Appointing a Sources folder is not mandatory but this helps you keep
your project structure in compliance with the PSR0 and PSR4 standards.
See Configuring PHP Namespaces in a Project for details.

测验

tests

推理:出于显而易见的原因,您的测试认情况下位于此处.您可能会为驻留在另一个文件夹中的javascript代码使用一些测试库.

Click this button to mark the selected folder as a test root.

排除在外

vendor, storage

推理:我们在项目中使用的所有(composer)库都位于供应商手中,但不是我们自己的代码.认情况下,我们不应该搜索它.
在存储实时缓存文件中,这些文件对我们而言没有重要意义,因此我们不会在版本控制中跟踪它们(例如供应商).我们可以删除它们,该应用程序仍然可以运行.

Click this button to mark the selected folder as excluded so PHPStorm
ignores it during indexing, parsing, and code completion.

资源根

public

推理:您自己的前端资产应位于公共文件夹下的某个位置(以供浏览器使用).前端资产是(主要是?)文件,javascript和CSS.

Click this button to enable PHPStorm to complete relative paths to
resources under the selected folder.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐