PHP:bootstrap.php
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6752091/
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
PHP: bootstrap.php
提问by luqita
What is bootstrap.php? I got a project that in the .htaccess reads SetEnv AE_BOOTSTRAP /full/path/to/_app/bootstrap.php
bootstrap.php 是什么?我有一个在 .htaccess 中读取的项目SetEnv AE_BOOTSTRAP /full/path/to/_app/bootstrap.php
However, that file does not exist in the project... Is this something from PHP?
但是,该文件在项目中不存在......这是来自PHP的东西吗?
回答by Charles Sprayberry
No, bootstrappingis not a part of PHP. Rather it is a file that is generally ran at installation time, or with PHP for every request, that takes care of making sure everything is included and general startup procedures are taken care of.
不,引导不是 PHP 的一部分。相反,它是一个通常在安装时运行的文件,或针对每个请求使用 PHP 运行的文件,它负责确保包含所有内容并处理一般启动程序。
回答by Patrick Desjardins
You can find more information about BootStrapping here.
您可以在此处找到有关 BootStrapping 的更多信息。
It's not a PHP feature but just some code that is executed at the start.
它不是 PHP 功能,而是一些在开始时执行的代码。
With regards to computer technology, “bootstrap PHP code” means creating a bootstrapper that handles all the dynamic requests coming to a server and apply the true MVC (Model View Component) framework so that in future you can change the functionality for each unique component or application without changing the entire code or application.
在计算机技术方面,“引导 PHP 代码”意味着创建一个引导程序来处理进入服务器的所有动态请求并应用真正的 MVC(模型视图组件)框架,以便将来您可以更改每个唯一组件的功能或应用程序而无需更改整个代码或应用程序。
This file should be on the server otherwise, nothing can be assigned via code...
该文件应该在服务器上,否则无法通过代码分配任何内容...
回答by chaos
bootstrap.php
is just a conventional name for a PHP file that loads up your project environment. If you have a .htaccess that's pointing to one that doesn't exist, that sounds like garbage left over from a dead software installation.
bootstrap.php
只是加载项目环境的 PHP 文件的常规名称。如果您有一个指向不存在的 .htaccess 的 .htaccess,这听起来像是死软件安装遗留下来的垃圾。
回答by Bogdan Mantescu
A Bootstrap is a script consisting of multiple clasees definitions in a single file, to reduce overhead of large variety of classes.
Bootstrap 是一个脚本,由单个文件中的多个 clasees 定义组成,以减少大量类的开销。
回答by eykanal
That's probably a line from a previous (or current) php framework, which would use that constant to define the path to their bootstrapping script.
这可能是来自以前(或当前)php 框架的一行,它将使用该常量来定义其引导脚本的路径。