Skip to content

evoRollback reference

Package parts

PartWhat it does
com_evorollbackThe core, the database store, the administration (versions, diffs, restore, undo and restore points) and the options.
plg_system_evorollbackLoads the adapters on every request so they listen to save events, and serves the licence field.
plg_evorollback_joomlaJoomla core adapter: articles, categories, modules, menu items, component options, template styles, field groups, workflows (with stages and transitions) and plugin parameters.
plg_evomcp_evorollbackevoMCP tools.
plg_webservices_evorollbackRead-only REST API.
plg_privacy_evorollbackExports and unlinks the versions made by a person.
plg_task_evorollbackDaily purge according to retention.

evoMCP tools

They exist only if evoMCP is installed. An entity is written as adapter:type:id, for example joomla:article:42.

ToolPermissionParametersWhat it does
rollback_adaptersreadnoneLists which extensions are versioned and their entity types.
rollback_historyreadentity (required), limit (1 to 100, default 20)Versions of an entity, newest first: id, date, reason (save, baseline, restore, point), who (user, ai or system), previous version and short hash. Without the data.
rollback_diffreadfrom (required), to (optional)Compares two versions of the same entity, or from with the current state if you omit to. Field by field (path, before, after); long values are cut at 400 characters.
rollback_restorewrite, always needs human approvalsnapshot_id (required), dry_runReturns the entity to that version. With dry_run it only shows what would change. Returns the changes, the reserved fields that are kept, and the ids of the previous and new versions.
rollback_undowrite, always needs human approvalsnapshot_id (the version created by rollback_restore), dry_runUndoes a restore: restores the version that existed just before.
rollback_create_pointwritelabel (3 to 190 characters), entities (1 to 50), dry_runCreates a restore point: fixes the current state of several entities at once.

Recommended flow: rollback_history, rollback_diff, rollback_restore with dry_run and, if the result is as expected, rollback_restore. Approving a restore from evoMCP requires a Super User. Component options are read and changed with options_get and options_set.

REST API (read-only)

  • GET /api/index.php/v1/evorollback/snapshots, with filters filter_adapter, filter_type and filter_entity_id and pagination page[limit] and page[offset].
  • GET /api/index.php/v1/evorollback/snapshots/:id, with the changes against the previous version.

It requires core.manage on the component.

Writing an adapter for another extension

An adapter is a plugin in the evorollback group that, on the onEvorollbackCollectAdapters event, registers a class implementing AdapterInterface:

  • key() and entityTypes(): its identifier and its entity types.
  • read(EntityRef): the data, or null if it does not exist. write(EntityRef, array): restores, always through the extension's models and never through SQL.
  • ignoredFields(), secretFields() and personalFields(): dotted paths with wildcards (for example params.*email*) for what does not count as a change and what is never stored.
  • canRecreate(): whether it can recreate a deleted entity.

The adapter starts the capture: it subscribes to its extension's save events, checks CaptureGate::allowed() and calls Backend::recorder()->record($ref, 'save', …). The Joomla adapter, plg_evorollback_joomla, is a complete example.