I see 'the bootstrap process' mentioned in Dayle Rees Laravel tutorial "Code Bright" but no explanation of what it actually means. The Wikipedia definitions on Bootstrapping in computing don't seem to have any particular relevance.
1 Answer
The bootstrap process is responsible to pickup all the different pieces that combine Laravel framework together before you start to process the request and return result. This could be further explained and analysed by looking at bootstrap files. There is folder bootstrap
in root directory containing these files:
- autoload.php - includes composer's autoloader, defines a few Laravel specific constants, initializes UTF-8 handling library etc. It is also responsible for loading any packages in
workbench
. - paths.php - this is just configuration array of relative paths. It allows you to move folders around or specify custom values. This is used so application knows where to look for various parts of framework.
- start.php - this is the actual bootstrap part. It initializes
Illuminate\Foundation\Application
class, detects environment, loads path configuration frompaths.php
and starts the Framework so further processing of the request can continue (routing etc.).
I hope this helped you to understand a bit more of what bootstrap is in Laravel framework. Feel free to have a look at these files as they are very well commented and will allow you have a more in-depth review yourself. If you still feel that you have any questions feel free to comment.
-
In that case I'm not sure bootstrapping is the most descriptive name for this process– blargCommented Apr 23, 2014 at 21:35
-
Could you please elaborate on the topic? I have met this term in various occurrences besides programming and I would see it as fit but I would like to hear more!– user120925Commented Apr 23, 2014 at 21:36
-
It could be named initialization, but bootstrapping isn't the bad word - for example Symfony2 contains
bootstrap.php
file insideapp
directory that contains compiled set of classes to speed up loading commonly used ones. Commented Apr 23, 2014 at 22:27 -
I agree. And keeping in mind that Laravel uses Symfony libraries you could understand why the naming was kept.– user120925Commented Apr 24, 2014 at 7:00