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

Place config.ini on different dir

Hi.

I'm trying to use only the Phalcon's Database/Models/ORM on an already existing project. My project doesn't follow the file tree suggested by the "project generator".

I would like to know how to make DevTools to read my config.ini, which is in a custom folder inside my project, so I could use the "model generator".

Thanks and sorry for the bad english.



2.5k

Hi,

Few weeks ago, I had a problem with config file, so I took a look at the phalcon devtools repository.

I found the class Component (here is the file on github) and especially the method _getConfig. In this, the code seems to try to find a config file inside the whole directory of the project and not only in the classic file tree of the devtools (as we can see here).

Unfortunatelly, I have no more information that may help you.

Thanks for the reply, b4v.

I already tried to create the path /app/config/config.ini and similars, but I still got the message "Error: Builder doesn't knows where is the models directory" when I try to execute "phalcon model --name lista_negra".

It should be easier to do such a trivial task, but I'll keep trying.



7.1k
Accepted
answer

Sorry guys, but I was using an old version of config.ini. I used DevTools to create a new project in a different path and copied the config.ini. Now everything is working fine!

Thanks again, b4v.