filemtime($yaml) ) { $config = json_decode(file_get_contents($configCache), true); $config['Slim']['db']= array( 'host' => 'n01.sql.joywork.ru.flops.dc.int', 'dbname' => 'u0305746_jw', 'user' => 'u0305746_jw', 'pass' => 'BzDIdQh3V' ); } else { $config = Symfony\Component\Yaml\Yaml::parse(file_get_contents($yaml)); $config['Slim']['db']= array( 'host' => 'n01.sql.joywork.ru.flops.dc.int', 'dbname' => 'u0305746_jw', 'user' => 'u0305746_jw', 'pass' => 'BzDIdQh3V' ); if (isset($config[$env])) { $config = $config[$env]; // Slim $config['Slim']['mode'] = $env; // Logger if (isset($config['Slim']['log.level'])) { $level = 'Slim\Log::'.$config['Slim']['log.level']; if (defined($level)) { $config['Slim']['log.level'] = constant($level); } else { throw new \Exception('Slim log level is incorrect.'); } } // View renderer $config['Slim']['templates.path'] = APP_PATH.'/templates'; $config['Slim']['db']= array( 'host' => 'n01.sql.joywork.ru.flops.dc.int', 'dbname' => 'u0305746_jw', 'user' => 'u0305746_jw', 'pass' => 'BzDIdQh3V' ); if (true === $config['Twig']['cache']) { $config['Twig']['cache'] = VAR_PATH.'/cache/twig'; } // save config cache file file_put_contents($configCache, json_encode($config)); } else { throw new \Exception("Environment $env not found in configuration file."); } } } else { throw new \Exception('Configuration file not found.'); } return $config;