Consolidate all paths to plugin flash dir, fix watchdog 7.3 triggers
- Move SCRIPTS_DIR/DATA_DIR/STATE_DIR from appdata to /boot/config/plugins/varaverk - All state files now in STATE_DIR (no more /tmp or /boot/config root writes) - Bootstrap: Gitea-first clone with GitHub fallback, no array dependency - varaverk.cfg seeded with Gitea connection settings - .gitignore: add State_Files/, varaverk.cfg, varaverk-*.txz - Partnership/transcode/fallback scripts use STATE_DIR variables - PHP config.php: DATA_DIR/STATE_DIR constants, VV_SETUP_STATE_FILE dynamic - deploy.sh PROD_ROOT updated to plugin flash dir Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
9191a54637
commit
fb0530deba
@@ -67,6 +67,12 @@ function vv_conf_parse_subsection(string $raw, string $subName, string $filename
|
||||
if (preg_match('/^#\s*[━─═=]{3,}/', $lines[$i])) { $end = $i; break; }
|
||||
}
|
||||
|
||||
return _vv_conf_parse_field_range($lines, $start, $end, $filename) ?: null;
|
||||
}
|
||||
|
||||
// Parse all config fields between two line indices. Shared by vv_conf_parse_subsection()
|
||||
// (per-script editor) and vv_conf_all_groups() (full settings view).
|
||||
function _vv_conf_parse_field_range(array $lines, int $start, int $end, string $filename): array {
|
||||
$fields = [];
|
||||
$pendingDesc = [];
|
||||
|
||||
@@ -138,7 +144,36 @@ function vv_conf_parse_subsection(string $raw, string $subName, string $filename
|
||||
}
|
||||
}
|
||||
|
||||
return $fields ?: null;
|
||||
return $fields;
|
||||
}
|
||||
|
||||
// Return ALL config groups (every named section + its fields) for a conf file.
|
||||
// Enumerates header lines (# ━━━ Name ━━━ or # ── Name ──); each group runs from its
|
||||
// header to the next named header so major sections (sandwiched in ===) capture their
|
||||
// settings too. Empty groups (divider-only headers) are dropped.
|
||||
function vv_conf_all_groups(string $filename): array {
|
||||
$raw = vv_read_conf_raw($filename);
|
||||
if ($raw === '') return [];
|
||||
$lines = explode("\n", $raw);
|
||||
$n = count($lines);
|
||||
|
||||
$headers = [];
|
||||
for ($i = 0; $i < $n; $i++) {
|
||||
if (preg_match('/^#\s*[━─]{2,}\s+([A-Za-z].+?)\s+[━─]{2,}/', $lines[$i], $m)) {
|
||||
$headers[] = ['name' => trim(preg_replace('/\s+/', ' ', $m[1])), 'line' => $i];
|
||||
}
|
||||
}
|
||||
|
||||
$groups = [];
|
||||
foreach ($headers as $idx => $h) {
|
||||
$start = $h['line'] + 1;
|
||||
$end = $headers[$idx + 1]['line'] ?? $n;
|
||||
$fields = _vv_conf_parse_field_range($lines, $start, $end, $filename);
|
||||
if ($fields) {
|
||||
$groups[] = ['subsection' => $h['name'], 'file' => $filename, 'fields' => $fields];
|
||||
}
|
||||
}
|
||||
return $groups;
|
||||
}
|
||||
|
||||
// Return all conf groups (subsection + fields) for a script on the current host.
|
||||
|
||||
Reference in New Issue
Block a user