R
R
Roman2014-12-11 17:26:53
Yii
Roman, 2014-12-11 17:26:53

How to change the CONSOLE configuration in YII2?

console.php
This doesn't work for some reason.

if($_SERVER['SERVER_NAME']=='basic-yii2.com'){

    $db = require(__DIR__ . '/db.php');
}else{
    $db = require(__DIR__ . '/db_live.php');
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Zelenin, 2014-12-11
@zelenin

the console is not accessible via the web, is not processed by the http server and, accordingly, there is no server_name
in yii2 presented a good concept of environments - you should have used it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question