} // try to read environment-specific configuration $environment_config_file = $root_directory . '/config/config.' . Project::getEnvironment() . '.yaml'; if (file_exists($environment_config_file)) { $environment_config = Utils::parse_yaml($environment_config_file); $config = array_replace_recursive($config, $environment_config); } $stats = $client->post('apps/deploy', array('modules' => $module_sync, 'schema' => Utils::parse_yaml($root_directory . '/schema.yaml'), 'schedule' => $schedule, 'config' => $config, 'security' => Utils::parse_yaml($root_directory . '/security.yaml'), 'packages' => Utils::parse_yaml($root_directory . '/packages.yaml'))); // remove auto-generated PHP files if (count($js_converted_modules) > 0) { foreach ($js_converted_modules as $module) { unlink($module); } } if (isset($stats->error)) { Console::error($stats->error); } if (isset($stats->schedule)) { Console::output("Schedule updated."); } if (isset($stats->schema) && $stats->schema > 0) { Console::output($stats->schema . " collection(s) migrated."); } if (isset($stats->modules)) { if ($stats->modules->removed > 0) { Console::output($stats->modules->removed . " module(s) removed."); } if ($stats->modules->updated > 0) { Console::output($stats->modules->updated . " module(s) updated."); } if ($stats->modules->uploaded > 0) {
$name = $config[0]; $value = $config[1]; // // Read or extract certificate file // -------------------------------- // if (file_exists($value)) { Console::output("Reading certificate file..."); $ext = pathinfo($value, PATHINFO_EXTENSION); if ($ext == 'p12') { $results = array(); $worked = openssl_pkcs12_read(file_get_contents($value), $results, null); if ($worked) { $value = $results['cert'] . $results['pkey']; } else { Console::error(openssl_error_string()); } } else { if ($ext == 'pem') { $value = file_get_contents($value); } } } array_push($configs_to_add, array('name' => $name, 'value' => $value)); } } foreach ($configs_to_add as $config) { Utils::array_set($configs, $config['name'], $config['value']); } $dumper = new Symfony\Component\Yaml\Dumper(); file_put_contents($config_file, str_replace(" ", " ", $dumper->dump($configs, 10)));