Question
How do I reload built-in automations and packages inside a migration patch file (e.g., `11.2.0.php`)?
Gap
No documentation exists for the migration patch system used in `features/cerberusweb.core/patches/`. Developers writing upgrade patches need to know:
-
Reimporting automations — Use `DAO_Automation::importFromJson($data)` with the parsed JSON from `assets/automations/`. This replaces the existing automation script in the database, so no separate `UPDATE` query is needed.
-
Reimporting packages — Use `CerberusApplication::packages()->importToLibraryFromFiles($files, $path)` with an array of package filenames and the base path to `packages/library/`.
Both patterns are demonstrated in `features/cerberusweb.core/patches/11.x/11.0.0.php`.
Closest existing page
None found.
Suggested content
A developer guide page covering:
- The patch file lifecycle (when they run, idempotency requirements)
- Pattern for reimporting built-in automations via `importFromJson`
- Pattern for reimporting packages via `importToLibraryFromFiles`
- Code snippet examples from 11.0.0.php
Question
How do I reload built-in automations and packages inside a migration patch file (e.g., `11.2.0.php`)?
Gap
No documentation exists for the migration patch system used in `features/cerberusweb.core/patches/`. Developers writing upgrade patches need to know:
Reimporting automations — Use `DAO_Automation::importFromJson($data)` with the parsed JSON from `assets/automations/`. This replaces the existing automation script in the database, so no separate `UPDATE` query is needed.
Reimporting packages — Use `CerberusApplication::packages()->importToLibraryFromFiles($files, $path)` with an array of package filenames and the base path to `packages/library/`.
Both patterns are demonstrated in `features/cerberusweb.core/patches/11.x/11.0.0.php`.
Closest existing page
None found.
Suggested content
A developer guide page covering: