| Conditions | 4 |
| Paths | 8 |
| Total Lines | 22 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function up(Schema $schema) |
||
| 19 | { |
||
| 20 | // config.ymlの更新 |
||
| 21 | $app = Application::getInstance(); |
||
| 22 | $file = $app['config']['root_dir'].'/app/config/eccube/config.yml'; |
||
| 23 | $config = Yaml::parse(file_get_contents($file)); |
||
| 24 | |||
| 25 | $appendConfig = array(); |
||
| 26 | |||
| 27 | // キーが未定義の場合は初期値を設定する |
||
| 28 | if (!array_key_exists('trusted_proxies_connection_only', $config)) { |
||
| 29 | $appendConfig['trusted_proxies_connection_only'] = 0; |
||
| 30 | } |
||
| 31 | if (!array_key_exists('trusted_proxies', $config)) { |
||
| 32 | $appendConfig['trusted_proxies'] = array(); |
||
| 33 | } |
||
| 34 | |||
| 35 | if (count($appendConfig)) { |
||
| 36 | file_put_contents($file, "\n", FILE_APPEND); |
||
| 37 | file_put_contents($file, Yaml::dump($appendConfig), FILE_APPEND); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | |||
| 49 |