v0.9.0

<p>Collection items move out of per-item folders into one SQLite database per collection field, which is never in git.</p>

19 October 2026

Added

  • Phlat\Data\Collection, reached as $app->collection('field'), holds a collection field's items for every page that has the field, in data/pages/_{field}/items.db. It has get(), find(), count(), sum(), create(), save() and delete(), and atomic() runs a batch of writes as one transaction. In Latte, {collection('comments')->get($uuid)} replaces item().
  • An item belongs to a page by its stored parent uuid. Moving the page changes nothing, deleting it deletes its items, and uuid:regenerate re-parents them (Collection::reparent()).
  • Item uuids are unique within a collection, not site-wide, so new() throws ConflictException on a duplicate in that collection.
  • An item's files are served at /_{field}/{shard}/{uuid}/{file} (PageFiles::serveCollection()). V::collectionField() and V::collectionSegment() define the one place a URL path may use _.
  • phlat collection:migrate moves items from the old per-item folders. collection:reindex rebuilds a collection's search tables after its field options change.
  • registry:check reports collections still in the old layout and items whose page is gone, and --heal sweeps them.
  • App::collections() and App::databases(). Db::snapshot() writes a database whole, Db::transaction() takes $immediate, and Dir::copy() takes a $skip callback.

Changed

  • backup:create and db:backup snapshot each collection's database, since collections are never in git and a backup is how they are kept. db:vacuum covers them too.
  • FieldTypeCollection is a page's view of the items in its collection.
  • Query and FieldIndex take the table they work on, so a collection has its own field and search indexes.
  • Collection items are no longer in the registry (schema 18), and Registry::locate() looks up pages only.
  • A page's History is its own files, those directly in its folder. Its log, diff, dirty state and restore no longer include its child pages. Delete and move still take the whole subtree.

Removed

  • The history option on collection fields. A collection is never in History.
  • App::item() and the item() template function, and the item rows, Item::fromRow() and Item::registryKeyFor().

Comments

No comments yet. Be the first!

Loading form…