Registry
SQLite index of every page UUID with its path, view, status and timestamps. find() queries it with the comma-separated DSL.
Properties (1)
| $registry->path | string | The registry file in use: the newest complete build of this SCHEMA, or the one the first build will write. |
- atomic Runs $fn as one transaction on the registry, so a bulk change pays for the disk once.
- boot Connects, building the first registry if there is none; while one request builds, the rest get a 503.
- count Total row count matching the same query DSL as rows(), ignoring limit/offset.
- delete Drops the rows matching $query, read as find() reads it (type=page unless the query names a type), and with them (FieldIndex::trigger()) their field_index/search_index rows.
- distinctValues Distinct non-empty values for a structural column (e.g. 'view'), sorted - used to populate filter selects.
- find Query the registry and return a typed collection.
- gate The [sql, params] that are true when no page closes $path to this visitor - $path being an SQL expression for a page path, and $registry the registry table as the caller reaches it ('reg.registry' from a database it attached).
- get The path of the page with this uuid, or null.
- index Brings the registry row and the record's field_index/search_index rows up to date - one call keeps every derived index current.
- locate Resolves a bare uuid (no type prefix) to its registry row, trying each candidate type in turn.
- mountOf The path of the first site page, by path, whose view is exactly $view, or null.
- pruneColumns Drops the columns of fields no view or role declares any more (FieldIndex::prune()).
- rebuild Rebuilds the registry by scanning all page and user directories.
- rows Same query DSL as find(), but returns raw rows (registry columns only) instead of hydrated Page/User objects.
- sumRows Sum of a number field over the rows matching $query, ignoring limit/offset.
- undeclaredColumns The fields with a column in the registry that no view or role declares any more.
- updatedAt Returns the `updated` timestamp for the site page at $path, or null if not indexed.
Methods
$registry->atomic(callable $fn): mixed
Runs $fn as one transaction on the registry, so a bulk change pays for the disk once.
Parameters (1)
| $fn | callable |
Returns mixed
phlat/src/Data/Registry.php:339
$registry->boot(): void
Connects, building the first registry if there is none; while one request builds, the rest get a 503.
phlat/src/Data/Registry.php:137
$registry->count(string $query = ''): int
Total row count matching the same query DSL as rows(), ignoring limit/offset.
Parameters (1)
| $query | string = '' |
Returns int
phlat/src/Data/Registry.php:449
$registry->delete(string $query): int
Drops the rows matching $query, read as find() reads it (type=page unless the query names a type), and with them (FieldIndex::trigger()) their field_index/search_index rows.
Parameters (1)
| $query | string |
Returns int
phlat/src/Data/Registry.php:460
$registry->distinctValues(string $column): array
Distinct non-empty values for a structural column (e.g. 'view'), sorted - used to populate filter selects.
Parameters (1)
| $column | string |
Returns array
phlat/src/Data/Registry.php:379
$registry->find(string $query = ''): RecordCollection
Query the registry and return a typed collection.
Parameters (1)
| $query | string = '' |
Returns RecordCollection
phlat/src/Data/Registry.php:418
$registry->gate(string $path, string $registry = 'registry'): array
The [sql, params] that are true when no page closes $path to this visitor - $path being an SQL expression for a page path, and $registry the registry table as the caller reaches it ('reg.registry' from a database it attached).
Parameters (2)
| $path | string | |
| $registry | string = 'registry' |
Returns array
phlat/src/Data/Registry.php:521
$registry->get(string $uuid): ?string
The path of the page with this uuid, or null.
Parameters (1)
| $uuid | string |
Returns ?string
phlat/src/Data/Registry.php:204
$registry->locate(string $uuid, array $types = [...]): ?array
Resolves a bare uuid (no type prefix) to its registry row, trying each candidate type in turn.
Parameters (2)
| $uuid | string | |
| $types | array = [...] |
Returns ?array
phlat/src/Data/Registry.php:219
$registry->mountOf(string $view): ?string
The path of the first site page, by path, whose view is exactly $view, or null.
Parameters (1)
| $view | string |
Returns ?string
phlat/src/Data/Registry.php:253
$registry->pruneColumns(): array
Drops the columns of fields no view or role declares any more (FieldIndex::prune()).
Returns array
phlat/src/Data/Registry.php:354
$registry->rebuild(?string $subtree = null, ?callable $onProgress = null): void
Rebuilds the registry by scanning all page and user directories.
Parameters (2)
| $subtree | ?string = null | |
| $onProgress | ?callable = null |
phlat/src/Data/Registry.php:562
$registry->rows(string $query = ''): array
Same query DSL as find(), but returns raw rows (registry columns only) instead of hydrated Page/User objects.
Parameters (1)
| $query | string = '' |
Returns array
phlat/src/Data/Registry.php:442
$registry->sumRows(string $query, string $field): float
Sum of a number field over the rows matching $query, ignoring limit/offset.
Parameters (2)
| $query | string | |
| $field | string |
Returns float
phlat/src/Data/Registry.php:484
$registry->undeclaredColumns(): array
The fields with a column in the registry that no view or role declares any more.
Returns array
phlat/src/Data/Registry.php:347
$registry->updatedAt(string $path): ?int
Returns the `updated` timestamp for the site page at $path, or null if not indexed.
Parameters (1)
| $path | string |
Returns ?int
phlat/src/Data/Registry.php:241