/
bear
/
opencorpora
Обзор
Документация
Войти
/
bear
/
opencorpora
Код
Запросы
0
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
phinx.php
31 строка
885 B
Dmitry Granovsky
use json config in php code (issue #760)
27 июн 2020, 12:00
27 июн 2020, 12:00
7cd4dbe
Код
Авторство
О чём код?
<?php $config = json_decode(file_get_contents(__DIR__ . '/../config.json'), true); return array( 'paths' => array( 'migrations' => __DIR__.'/migrations', ), 'environments' => array( 'default_migration_table' => 'phinxlog', 'default_database' => 'corpora', 'production' => array( 'adapter' => 'mysql', 'host' => $config['mysql']['host'], 'name' => $config['mysql']['dbname'], 'user' => $config['mysql']['user'], 'pass' => $config['mysql']['passwd'], 'port' => '3306', 'charset' => 'utf8', ), 'development' => array( 'adapter' => 'mysql', 'host' => '127.0.0.1', 'name' => 'corpora', 'user' => 'root', 'pass' => '', 'port' => '3306', 'charset' => 'utf8' ), ), );