Commit Graph

11 Commits

Author SHA1 Message Date
Jordan Diaz
031ef33f9f fix: devolver valores como string en las lecturas (paridad mysql_* legacy)
PDO con prepares nativos devuelve tipos reales (depth=int 0) mientras que
mysql_* devolvia siempre strings. Los templates y codigo Acai comparan
estrictamente contra strings (is same as('0'), === '1'...) y con tipos
nativos esos filtros fallan en silencio — p.ej. el menu del header vacio
en webs importadas (impulse) porque el filtro depth is same as('0') no
matcheaba int(0). stringifyRows normaliza todos los escalares no-NULL a
string en los 5 paths de lectura que devuelven datos hacia fuera: get(),
uploads, cache de queries de relaciones, traducciones y pluginsConfig.
2026-07-22 11:14:55 +00:00
Jordan Diaz
fe7e9ee2e6 fix: no inyectar campos de auditoria en tablas raw (ignoreSchema)
buildSetClause añadia siempre updatedDate/updatedByUserNum (y en inserts
createdDate/createdByUserNum), pero las tablas raw que se escriben con
ignoreSchema (aux_plg_config, uploads, traducciones...) no tienen esas
columnas y el INSERT/UPDATE moria con Unknown column — p.ej. guardar la
config de un plugin desde el dashboard fallaba con 'No se pudo guardar la
configuracion en la base de datos'. Se replica la semantica del CocoDB
legacy: prepareBaseSQL solo añadia auditoria y defaults cuando habia
schema cargado.
2026-07-22 09:40:13 +00:00
Jordan Diaz
34d1458f3a perf: self-provision the traducciones index required by batched t()
The batched translation preload requires the (tableName, recordNum,
prefix) index; without it the per-record query scans and is slower
than the legacy per-field lookup. t() now checks once per PHP process
(static) whether idx_tabla_registro_prefijo exists, creates it on the
fly when the DB user has ALTER rights (re-checking after a lost race),
and otherwise falls back to the legacy per-field query — never slower
than the original behavior on webs where the index cannot be created.

Verified live: dropped the index on villagrancanaria local, first
request recreated it automatically and subsequent renders stayed fast.
2026-07-21 18:34:10 +00:00
Jordan Diaz
bcd21dd274 perf: batch per-record translation preload in t()
t() issued one SELECT per translated field (1,300+ queries on a typical
multilanguage home). It now preloads all translations of a (table,
record, language) in a single query and serves subsequent fields from
memory, preserving the previous LIMIT 1 semantics (first row per
fieldName). Measured on villagrancanaria: cold render -60% (en home)
/ -67% (es home), byte-identical output.

REQUIRES index (tableName, recordNum, prefix) on cms_traducciones —
without it the batched query scans and is SLOWER than before:
ALTER TABLE cms_traducciones ADD INDEX idx_tabla_registro_prefijo (tableName, recordNum, prefix);
2026-07-21 18:29:46 +00:00
Jordan Diaz
432130565b AcaiAPI data layer + CocoDB facade
AcaiAPI: PDO-based data access layer (prepared statements, JOIN relation
loading, batch upload fetching) developed on villagrancanaria.
CocoDB_alias declares the CocoDB facade delegating to AcaiAPI; the
legacy implementation stays available as CocoDB_old.
2026-07-21 17:29:51 +00:00
Jordan Diaz
dd2657a5d3 CmsApi Libraries 2026-06-09 09:44:45 +00:00
Jordan
927888d0d9 Update CocoDB.php 2026-05-12 18:33:16 +01:00
Jordan
4e4bfde8a5 Quitando payments 2026-03-05 19:01:22 +00:00
Jordan
48fab839d0 Añadiendo los plugins base payments y cms_api 2026-03-05 18:31:21 +00:00
Jordan
a3452623bf Add settings.dat.php as empty template for installations
Credentials and personal data cleared, kept as blank
template that gets filled during remote installations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 20:30:46 +00:00
Jordan
03acc5b013 Initial commit: plantilla base PHP para webs Acai CMS 2026-02-21 21:13:57 +00:00