PHP: bootstrap.php

社会主义新天地 提交于 2019-12-06 17:26:29

问题


What is bootstrap.php? I got a project that in the .htaccess reads SetEnv AE_BOOTSTRAP /full/path/to/_app/bootstrap.php

However, that file does not exist in the project... Is this something from PHP?


回答1:


No, bootstrapping is 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.




回答2:


You can find more information about BootStrapping here .

It's not a PHP feature but just some code that is executed at the start.

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.

This file should be on the server otherwise, nothing can be assigned via code...




回答3:


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.




回答4:


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.




回答5:


A Bootstrap is a script consisting of multiple clasees definitions in a single file, to reduce overhead of large variety of classes.



来源:https://stackoverflow.com/questions/6752091/php-bootstrap-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!