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
| const | TTL = 86400 | |
| const | ENGINE_SOURCE = 'https://updates.minn.run/v1/minn/changelog' | |
| const | ADMIN_SOURCE = 'https://updates.minn.run/v1/minn-admin/changelog' | |
| private | readonly Closure $load | Promoted from the constructor. |
| private | readonly Closure $save | Promoted from the constructor. |
| private | readonly string $source | Promoted from the constructor. |
| private | readonly 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, )))# |
| ||||||
| static | engine(Minn\Content\Site $site): self# | Minn's changelog for a site, kept in its minn_changelog option. | ||||||
| static | admin(Minn\Content\Site $site): self# | Minn Admin's changelog for a site running Minn, kept in its minn_admin_changelog option. | ||||||
| method | markdown(): string# | The released sections as Markdown, fetched first when the copy is a day old; '' when there is none. | ||||||
| static | released(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.
| private | kept(Minn\Content\Site $site, string $option, string $source): self# |
Nothing matches.