php 光明在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38319050/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where is Illuminate?
提问by sCha
Every time when I try to do some modifications in certain area, Authentication for example, I end up finding everything is declared in Illuminate\Foundation\...
.
每次当我尝试在某些区域进行一些修改时,例如 Authentication,我最终发现所有内容都在Illuminate\Foundation\...
.
Okay, now all I need to do is get to that location and look into some codes.
好的,现在我需要做的就是到达那个位置并查看一些代码。
But hey, where is this Illuminate
and all stuff???
但是,嘿,这个Illuminate
和所有东西在哪里???
I don't see any folders named Illuminate anywhere in my Laravel package.
我在 Laravel 包中的任何地方都没有看到任何名为 Illuminate 的文件夹。
Tried to search for the solution but I guess I'm the only silly person who lacks ability in understanding some basics.
试图寻找解决方案,但我想我是唯一缺乏理解一些基础知识的愚蠢人。
回答by James
Just to officially answer this question.
来正式回答这个问题。
The files OP was looking for, along with any other Laravel or package files, are stored in the vendor folder - which you can access from the root Laravel directory.
OP 正在寻找的文件以及任何其他 Laravel 或包文件都存储在 vendor 文件夹中 - 您可以从 Laravel 根目录访问该文件夹。
As @Gavin points out in the comments:
正如@Gavin 在评论中指出的那样:
Illuminate is located in /vendor/laravel/framework/src/Illuminate
Illuminate 位于 /vendor/laravel/framework/src/Illuminate
回答by geckob
Laravel take the advantage of the autoload features in Composer.
Laravel 利用 Composer 中的自动加载功能。
One quick and simple tips:
一个快速而简单的提示:
You can actually find this in composer.lock
file. Then find the PSR autoload. For instance, for Laravel/framework
:
您实际上可以在composer.lock
文件中找到它。然后找到PSR自动加载。例如,对于Laravel/framework
:
{
"name" : "laravel/framework",
.......
.......
"autoload": {
"classmap": [
"src/Illuminate/Queue/IlluminateQueueClosure.php"
],
"files": [
"src/Illuminate/Foundation/helpers.php",
"src/Illuminate/Support/helpers.php"
],
"psr-4": {
"Illuminate\": "src/Illuminate/"
}
}
}
Since there are a lot of packages in vendor
folder, refer the name of the package in the composer.lock. For example, Illuminate is under laravel/framework
packages. Then, look for vendor/laravel/framework
由于vendor
文件夹中有很多包,请在composer.lock中引用包名。例如,Illuminate 在laravel/framework
包下。然后,寻找vendor/laravel/framework
Then you know, Illuminate
is mapped to vendor/laravel/framework/src/Illuminate
然后你知道,Illuminate
被映射到vendor/laravel/framework/src/Illuminate