Skip to content

0.8.0

Choose a tag to compare

@somework somework released this 07 Sep 17:30
· 3 commits to main since this release

Added

  • Console\SitemapRunner takes ?Psr\Clock\ClockInterface $clock = null (appended) and changedSince(?string $option, ?DateTimeImmutable $now = null) counts a relative --changed-since ("1 day") back from $now (wave M, spec 19 §4.9,
    PSR-20): SitemapServices::runner(…, ?ClockInterface $clock = null) passes the graph's clock, so Testing\FrozenClock
    moves the sitemap filter with the debounce window and the submission timestamps. Before, the runner read the wall
    clock through new DateTimeImmutable('-1 day') — the one place of the family a frozen clock could not reach. An
    absolute date is taken as it is, as before.

  • Console\SitemapCommand (wave L, spec 18): the indexnow:sitemap command itself as a symfony/console class over
    Console\SitemapRunner, with #[AsCommand]; Sitemap\Adapter\SitemapServices::command($runner, $sitemapUrlOption)
    builds it. The Symfony bundle and the Yii3 package register this class instead of a copy of their own; an adapter
    without the package registers Console\Command\SitemapNotInstalledCommand of indexnowkit/console under the same
    name. Constructor: (SitemapRunner $runner, string $sitemapUrlOption = 'sitemap.url') — the second names the
    adapter's sitemap.url option in the help.

  • Console\SitemapRunner takes bool $enabled = true (appended) and answers sitemap.enabled is false. with exit 2
    when it is off; SitemapServices::runner() passes SitemapConfig::$enabled. Before, the Yii3 command checked the flag
    itself and the bundle registered no command at all (it still does); the one place is now the runner, whatever the
    adapter chose.

Changed

  • Requires indexnowkit/console ^0.5 (the command classes and the stubs live there).

  • A <loc> on a host this site has no key for is dropped (Console\SitemapRunner), before anything fetches or
    submits it: only the hosts KeyProviderInterface::managedHosts() names — base_url plus the hosts map — pass,
    whatever source produced the entries. One line in the run summary (on stderr with --json) says how many URLs were
    skipped and on which hosts. Nested sitemaps were already restricted to the origin of the root; the entries were not,
    so a sitemap built from user content (or a swapped one) could make the pre-flight of indexnowkit/verify GET
    internal addresses. With no key at all (neither base_url nor a hosts map) nothing can be compared: the entries go
    as they are, with one warning. strict_hosts: true is documented as the recommendation for a sitemap built from user
    content.

  • Sitemap\Adapter\SitemapServices::package() delegates to the core's Adapter\OptionalPackage::sitemap() (core
    0.13.0): the name, the marker and the feature word live there, so an adapter asks about the package without loading
    this class. Same object, same texts; adapters should call OptionalPackage::sitemap() directly.

  • Requires indexnowkit/core ^0.13.