We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Custom bootstrap file for phalcon devtools?

Hi,

is there anyway to tell the phalcon devtools which file to use for boostrapping? It seems to me, that currently the app/config/config.ini or app/config/config.php are loaded.

In my case this is not ideal, because I would like to have a more sophisticated bootstrap file (e.g. app/bootstrap/bootstrap.php) that defines constants and includes a set of configuration files and config.php is just one of those. If bootstrap.php is not loaded it messes up the configuration. Obviously I could change the config.php to account for this scenario but I would prefer to keep the config.php as simple as possible.

I'm new to phalcon, so maybe I'm missing something obvious. I have been looking around for a way to set the bootstrapping file for the phalcon devtools but I haven't found anything.



6.2k

I think you have to manually do that. In the public/index.php require to the file app/bootstrap.php as you want.

This is my project that i'm just started and not finished, I hope it can be help. (It is not use custom bootstrap.php)

I'm new to Phalcon too. :)



2.1k

Changing the public/index.php is the way to go for customizing the bootstrapping when the app is called via HTTP. But the pahlcon devtools (calling phalcon from the command line) seem to have their own bootstrapping logic and my question is how I can customize this one.



6.2k

yep, i just have same problem like you. sorry.

Changing the public/index.php is the way to go for customizing the bootstrapping when the app is called via HTTP. But the pahlcon devtools (calling phalcon from the command line) seem to have their own bootstrapping logic and my question is how I can customize this one.