Answer the question
In order to leave comments, you need to log in
Why does Yupe (Yii) need index-test.php?
Why is index-test.php needed, which is actually a copy of index.php minus the config file?
Maybe I don't understand the principle of this separation, but...
As for me, I would make index-test.php just an entry point, for example, to set cookies and run index.php.
For example, like this:
// -- Устанавливаем куки, чтобы определять, что сейчас мы в режиме тестирования
$_COOKIE['CODECEPTION_COOKIE'] = 1;
setcookie('CODECEPTION_COOKIE', 1);
// -- -- -- --
require_once('index.php');// Подключаем основной файл
// -- Подключаем разные конфиги в зависимости от того, тест это или рабочая версия сайта
if (array_key_exists('CODECEPTION_COOKIE', $_COOKIE)) {
$configFile = 'test';
} else {
$configFile = 'main';
}
// -- -- -- --
if (!ini_get('date.timezone')) {...}
mb_internal_encoding('UTF-8');
mb_regex_encoding('UTF-8');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question