Skip to content
Corex

ReleaseSwap

Corex\Config\Releases\ReleaseSwap · class · Config layer

A release put in the place of the one that is running (spec 107, plan D6; FR-020, FR-022, FR-026). By renames, which a filesystem makes whole or not at all: each folder of the running release is moved out to previous/, and the staged folder moved in. A folder the running release owned and this one does not hold is moved out as well. A folder the package does not name is never touched, whatever it is. Every rename is in the journal before it is made. Cut off between two of them, the site is part one release and part the other, and the next request settles it: it finishes the swap, or, when a folder will not move, puts back every one that did.

__construct(ReleaseStore $store, ReleaseStaging $staging, ReleaseJournal $journal, string $siteRoot, ?Closure $rename)

Section titled “__construct(ReleaseStore $store, ReleaseStaging $staging, ReleaseJournal $journal, string $siteRoot, ?Closure $rename)”

swap(ReleaseManifest $manifest, array $ownedBefore, array $about): void

Section titled “swap(ReleaseManifest $manifest, array $ownedBefore, array $about): void”

Put the staged release in place. What the last installation replaced is set aside first, by one rename: one previous release is kept. Deleting it is left to a request that holds nobody off (FR-024b).

Settle a swap a request was cut off in the middle of.

Whether the last swap has moved no folder: every rename in its journal is still to be made, or was being made when its request died and the folders say it was not (FR-022a).

Go back: every rename the last swap made, made the other way, last first.