gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 01:13:52 24 4
gpt4 key购买 nike

我应该将哪些文件夹标记为 Sources/Resources/Excluded?

enter image description here

最佳答案

我自己的逻辑基于the PHPStorm guide

来源

The root folder

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

替代方案:只需标记您在 app, bootstrap, config, routes, (more...)

中包含代码的真实文件夹

Click this button to mark the selected folder as the root fornamespaces used in your project. Based on this setting, PhpStormsuggests you the proper folder name when you want to create a newnamespace under another parent namespace during creation or moving aPHP class, that is, when you are actually creating or moving a PHPclass to a non-existing namespace under another parent namespace. Ifno Sources folder is specified, you will have to type the properfolder manually.

Appointing a Sources folder is not mandatory but this helps you keepyour 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, node_modules

推理:我们在项目中使用的所有( Composer )库都在 vendor 中,但不是我们自己的代码。我们不应该默认搜索它。在存储实时缓存文件时,对我们没有重要意义的文件,我们不会在版本控制(如供应商)中跟踪它们。我们可以删除它们,应用程序仍然可以工作。与 node_modules 相同,但此目录用于 javascript 包。

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

资源根

public

推理:您自己的前端 Assets 应该(某处)在公共(public)文件夹下以提供给浏览器。前端 Assets (主要是?)文件、javascript 和 css。

Click this button to enable PhpStorm to complete relative paths toresources under the selected folder.

关于php - 如何在 IntelliJ IDEA 中配置 Laravel 项目结构?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45181909/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com