Drafts
Every change is a draft of the signed-in user, saved with Ctrl+S and automatically a second and a half after you stop typing. Drafts stay until they are published or discarded. When the file changed since your draft started, the draft is outdated: it opens with a note and a Compare button, and you can merge it with the file as it is now.
What a publish does
- "Verify it's you", when your confirmation is not fresh.
- The lint gate: php -l for PHP, the template compiler for templates, a JSON check for JSON. Errors refuse the publish and are listed in Problems; warnings only show.
- A backup of the previous version of the file.
- The file is written through a temporary file and one rename, keeping its mode.
- A git commit of that one file in its own repository, with a house prefix (Updated:, Added:, Removed:, Renamed:). Never pushed.
- The caches the file affects: templates clear the template, template-block and content caches; INI files the INI caches; stylesheets and scripts the packer.
- An audit record with the checksum before and after, never the text.
Changesets and going back
- Put drafts into a named changeset and publish it all or nothing: every file is checked first, and if one write fails, the files already written are put back. One commit per repository, one cache clear for all.
- "Recent publishes" lists single publishes and changesets; Revert puts every file back to its backup in one step, with its own commit.
- Files that are gone but have a backup can be restored as a draft.
- From the console: ./console exp:code:rollback --list, then --entry=<id> or --file=<path> --backup=<id>, a dry run until --apply.
Deploying a PHP or INI change
With DeployAfterPublish=enabled in code.ini, a published PHP or INI file runs the deploy command of the installation, by default exp:velocity deploy --no-fpm --no-velocity, and its PASS and FAIL lines show in Output.
More: Drafts and changesets and Publish a set of changes and roll it back in the manual.