Is bootstrap file a controller?

44 views Asked by At

Sometimes, there are things that should be done at the very beginning of execution. And, I called it 'bootstrap' or 'initialization'.
In bootstrap file, I usually disable the magic quotes at the runtime, set up the database adapter,defining paths, registering the autoloader, etc.
Is it right to put that bootstrap in BaseController __construct() method ? Or in the FrontController ? Or, should I just leave it as bootstrap.php ?

1

There are 1 answers

0
Henrique Barcelos On BEST ANSWER

No, bootstrap file is for initialization.

A controller is resoponsible for handling user input (requests in a web environment) and providing him an output (responses in a web environment).

A front controller is just a centralized point for handling incomming requests.

None of these compoments should have the responsibility of initializing your application.