A
A
adrash kh2018-11-06 09:57:01
Yii
adrash kh, 2018-11-06 09:57:01

How to edit config/db.php to set up yii2 repository?

Good afternoon.
There is a cloned yii2 repository. I have configured the hosts, now it requires a database connection. I was given login, password and server and set up a confid/db.php file. How can I properly solve this problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Beloborodov, 2018-11-06
@kowap

I solve it like this. In web/index.php I declare a constant
I add db-local.php to the config folder, I connect to the local database there (you need to download the database from the server and load it for yourself)
I connect it to config/web.php like this

'db' => LOCALHOST ? require __DIR__ . '/db-local.php' : require __DIR__ . '/db.php';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question