Adjusting comments into files.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
$config_path = __DIR__ . '/config.json';
|
||||
|
||||
// Migration automatique ancien format
|
||||
// Automatically migrate the legacy config format.
|
||||
if (file_exists($config_path)) {
|
||||
$existing = json_decode(file_get_contents($config_path), true);
|
||||
if (isset($existing['epg_url']) && !isset($existing['epg_sources'])) {
|
||||
@@ -14,7 +14,7 @@ if (file_exists($config_path)) {
|
||||
unset($existing['epg_url'], $existing['m3u_url']);
|
||||
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
// Bootstrap : config existante sans cle admin -> on en genere une maintenant
|
||||
// Bootstrap an admin key for older configs that do not have one yet.
|
||||
if (empty($existing['admin_key'])) {
|
||||
$existing['admin_key'] = bin2hex(random_bytes(16));
|
||||
file_put_contents($config_path, json_encode($existing, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
|
||||
|
||||
Reference in New Issue
Block a user