<?php
/**
 * GET  /api/lab/get_config.php         — config global del lab
 * GET  /api/lab/get_config.php?forma=1 — config como objeto clave=>valor (para el builder)
 */
require_once __DIR__ . '/_helpers.php';
requireMethod('GET');

$db   = Database::getInstance();
$rows = $db->fetchAll('SELECT clave, valor FROM lab_config ORDER BY clave');

$cfg = [];
foreach ($rows as $r) {
    $cfg[$r['clave']] = $r['valor'];
}

jsonOk(['config' => $cfg]);
