API / Minn\Ops / Changelog

Changelog final class

Minn\Ops\Changelog · public/minn/src/Minn/Ops/Changelog.php · 68 lines

A changelog read from its repository rather than shipped: a Minn release carries no notes, its own or Minn Admin's, for anyone to find on the sites that run it. The update service reads changelog.md from the repository's default branch on GitHub; the engine asks the service at most once a day and keeps the copy in an option (JSON) with the time it came; sections still marked Unreleased are left out, so a site only reads about releases that exist. A fetch GitHub does not answer keeps the last copy; a 404 (no such file, or a private repository) keeps nothing.

Constants and properties

constTTL = 86400
constENGINE_SOURCE = 'https://updates.minn.run/v1/minn/changelog'
constADMIN_SOURCE = 'https://updates.minn.run/v1/minn-admin/changelog'
privatereadonly Closure $load

Promoted from the constructor.

privatereadonly Closure $save

Promoted from the constructor.

privatereadonly string $source

Promoted from the constructor.

privatereadonly Minn\Http $http

Promoted from the constructor.

Public

new__construct(Closure $load, Closure $save, string $source, Minn\Http $http = \Minn\Http::__set_state(array( 'within' => array ( ), 'fake' => NULL, 'refusal' => NULL, )))#
$loadClosure(): ?stringthe stored copy, as JSON
$saveClosure(string): voidkeeps the copy, as JSON
staticengine(Minn\Content\Site $site): self#

Minn's changelog for a site, kept in its minn_changelog option.

staticadmin(Minn\Content\Site $site): self#

Minn Admin's changelog for a site running Minn, kept in its minn_admin_changelog option.

methodmarkdown(): string#

The released sections as Markdown, fetched first when the copy is a day old; '' when there is none.

staticreleased(string $markdown): string#

The changelog without its Unreleased sections.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatekept(Minn\Content\Site $site, string $option, string $source): self#