PHP: bootstrap.php
Asked Answered
H

5

19

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?

Haematozoon answered 19/7, 2011 at 18:19 Comment(0)
W
29

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.

Windup answered 19/7, 2011 at 18:21 Comment(2)
This article is better than the one you gave: binpress.com/tutorial/php-bootstrapping-crash-course/146Epistemic
But the example given at binpress is not psr-1 compliant.Cowie
M
20

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...

Monochasium answered 19/7, 2011 at 18:21 Comment(0)
S
5

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.

Sunda answered 19/7, 2011 at 18:23 Comment(0)
E
1

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.

Erythrocyte answered 19/7, 2011 at 18:22 Comment(0)
R
1

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

Reaction answered 7/4, 2014 at 11:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.