The Game Panel Design record
The Game Panel

Glossary

Terms used across this project's design record, exported from the repository.

A

Abstract

#abstract

The class or interface a binding is registered for and a resolution requests. A binding holds it alongside the concrete class instantiated in its place, and an alias points at it.

Alias

#alias

Another class name that resolves through the same binding as its abstract. The alias map is consulted once, so an alias pointing at another alias is not followed.

Ambient scope

#ambient-scope

The module scope at the top of the scope stack, which a resolution runs under.

B

Binding

#binding

Registered resolution information for one class or interface in the dependency injection container: the concrete class to construct in its place, an instance, or a factory, together with its aliases, its named and qualified child bindings, its lifetime, and whether it is liminal or lazy.

Bundled module

#bundled-module

A first-party module shipped inside the binary, with its manifest declared in code.

C

Capability

#capability

Something a module declares it does, such as `CrossRoutes`, checked by whatever enforces it.

Catalogue

#catalogue

An immutable, read-only collection consumed at runtime, the counterpart of a registry. For example, the configuration catalogue is sealed from the configuration registry, and the dependency injection container is constructed with a binding catalogue and a resolver catalogue.

Collection

#collection

A component asking modules to contribute, at a moment the component chooses, such as every enabled module, at boot or on first use.

Collector

#collector

What a component hands to modules so they can contribute to it, one for each type of contribution, such as routes or middleware.

Compiled output

#compiled-output

A file the engine writes for PHP to include, such as a compiled template or module metadata. It is kept under the compiled root, apart from cached content.

Compiled SQL

#compiled-sql

The SQL of a statement or a fragment of one, together with the values bound to it. Composing fragments concatenates their SQL and their values in the same order.

Compiler

#compiler

Turns a node into SQL and its bound values by resolving the compiler registered for the node's class, recursing for the nodes it contains.

Concrete

#concrete

The class the dependency injection container instantiates in place of an abstract. A binding's concrete class is added to its aliases when one is set.

Condition

#condition

One comparison in a `WHERE`, `HAVING` or join clause, joined to the one before it with `AND` or `OR`.

Configuration object

#configuration-object

An instance of a class unique to one configuration, holding that configuration's values as typed properties. It is registered against a module and a name, its class maps to exactly one module and name, and the configuration catalogue looks it up by either.

Configuration tree

#configuration-tree

The array produced by reading and merging every configuration file. Configuration objects are hydrated from its sections.

Connection

#connection

An open connection to one database, identified by the name it is configured and requested under, wrapping a PDO connection. It executes queries and statements that write, and manages transactions.

Core configuration

#core-configuration

Configuration hydrated before the module system runs, because the module system needs it. `ModulesEnabled` is the only core configuration object.

Cursor

#cursor

The rows returned by a query, fetched one at a time as they are iterated, so that a large result is processed without every row being held in memory at once. Its rows can be iterated once.

Cycle

#cycle

A unit of work that whatever drives the dependency injection container opens and closes around it, such as handling a request, running a job or a scheduler tick. An instance with a cycle lifetime is kept until its cycle closes.

D

Dependency

#dependency

A parameter the dependency injection container has to supply, described by its name, type, default, and the attributes that affect its resolution.

Deployment

#deployment

One change to the code an installation runs, applied as a unit: a new binary, or installing, updating, downgrading or purging one external module.

Disposal

#disposal

Releasing what a cycle instance holds when its cycle closes, such as an open transaction, a buffered log writer or an unsaved session.

Disposal list

#disposal-list

The cycle instances the dependency injection container disposes of when their cycle closes, in the order they were constructed. They are disposed of from the last to the first, so an instance is disposed of before the instances it depended on when it was constructed.

Drop-in

#drop-in

A TOML file in `config.d`, merged over the main configuration file in filename order. Where both values are arrays and neither is a non-empty list they merge recursively, and otherwise the drop-in's value replaces the one already there.

E

Effective liminality

#effective-liminality

Whether a resolution is liminal, worked out from every source that can make it so, such as the resolution itself, its binding and its class.

Engine

#engine

The part of the panel that modules are built on. It shares one repository with those modules, the entry point and the build that produces the binary.

Entity identifier

#entity-identifier

An entity's identity: a ULID with a type of its own for each entity, so that one entity's identifier cannot be passed where another's is expected.

Entity map

#entity-map

The entities loaded or saved during one unit of work, each held with the snapshot it came from. Two reads of the same row give the same object.

Environment variable

#environment-variable

A value supplied through the process environment or an env file. Environment variables are read during bootstrap, held by `Env`, and interpolated into the configuration tree as it loads.

Explicit scope

#explicit-scope

A module scope named at a parameter, such as with the `Scoped` attribute, used for that one dependency instead of the ambient scope.

Expression

#expression

An object that produces SQL, with a `?` placeholder for each bound value, together with the values bound to those placeholders. Every object in the query builder and the schema builder is one, and an expression containing other expressions builds its SQL from theirs and gathers their bound values in the same order.

External module

#external-module

A module installed as a Composer package of type `tgp-module` into the modules directory, with its metadata declared in its `composer.json`.

G

Ghost object

#ghost-object

An object of the final class that the dependency injection container creates uninitialised. When it is first accessed, its constructor runs on that same object through the container, and from then on it is the instance itself rather than a stand-in for one. A dependency is resolved as a ghost object with the `Ghost` attribute.

Given filesystem

#given-filesystem

A filesystem constructed by whatever composes the engine and handed to the filesystem catalogue, such as the configuration, data or cache filesystem.

H

Handler reference

#handler-reference

How a listener is registered and stored without being constructed: the name of an invokable class, or a class name and a method name.

I

Instance cache

#instance-cache

A store of shared instances, keyed by class, and by name or qualifier class where a resolution has one. Each holds its instances either strongly or through weak references.

Invocation

#invocation

Calling a callable, method or constructor with its parameters supplied by the dependency injection container, and the object that describes such a call, including any arguments supplied up front by parameter name.

L

Lazy proxy

#lazy-proxy

A stand-in that the dependency injection container returns in place of an instance not yet resolved. When the proxy is first used, the container resolves the real instance, and the proxy forwards to it from then on, remaining a proxy.

Ledger

#ledger

The table recording which migrations have run on an installation, for each module, and the deployment that applied each.

Lifetime

#lifetime

How long the dependency injection container keeps an instance it has resolved: for the life of the worker, for one cycle, or not at all, a new instance being resolved every time.

Liminal

#liminal

Describes a shared instance with a process lifetime, held by the dependency injection container through a weak reference, so that garbage collection can clear it once nothing else uses it, after which the next resolution produces a new instance.

M

Maintenance mode

#maintenance-mode

A state the panel is put into while something that must not run alongside requests is under way, such as migrations, in which it refuses requests.

Manifest

#manifest

The resolved metadata describing one module, such as its identifier, version, declared capabilities and registrar class.

Match set

#match-set

The listeners that match one concrete event class, in the order they were registered. It is worked out the first time an event of that class is dispatched, and kept.

Migration identity

#migration-identity

The name a migration declares for itself, stable across releases, by which the ledger and the migration map know it within its module. A released one is never removed from what its module collects.

Migration map

#migration-map

A record carried by each released version of an external module, mapping each of its migrations to the version that introduced it, which a downgrade reads to find what to reverse.

Module

#module

The unit the panel is extended with, first-party and third-party alike, and the owner a configuration is registered against. The engine's own configuration is registered against a module like any other, and a core feature that combines several components is a module itself.

Module dependency

#module-dependency

A module's declared need for another module, recorded in its manifest, such as for that module's tables to exist before its own refer to them. The module system checks declared dependencies and orders modules by them.

Module identifier

#module-identifier

A module's name, such as `billing`, which a bundled module declares and an external module takes from its package name. An identifier containing a dot throws.

Module scope

#module-scope

The module a binding registry is created for. Each binding records the module scope it was registered under.

Module source

#module-source

Where every module's manifest and registrar metadata come from, whether compiled ahead of time or reflected.

N

Named binding

#named-binding

A child binding of an abstract, selected by a string name. A dependency selects one with the `Named` attribute, and a resolution with `named()`.

Node

#node

An object describing part of a statement, such as a query, a column or an index, which a compiler turns into SQL.

O

Owner

#owner

The module that registered a binding. A binding the engine registers itself has no owner.

P

Panel context

#panel-context

The part of the panel a route belongs to, which decides its URL prefix.

Primary connection

#primary-connection

The connection used whenever no connection name is given. Its name is configured, and a connection must be configured under that name.

Primitive

#primitive

A thin wrapper, with no policy, over something PostgreSQL provides that a later subsystem needs, such as notifications or advisory locks.

Provider

#provider

An object injected in place of an instance, which resolves that class each time it is asked, against whichever cycle is open at that moment. A longer-lived object uses one to reach an instance belonging to the current cycle.

Purge

#purge

Removing an external module together with its schema and its ledger rows, after reversing those of its migrations that can be reversed.

Q

Qualified binding

#qualified-binding

A child binding of an abstract, selected by a qualifier attribute rather than by a name. A dependency selects one by carrying the attribute, and a resolution with `qualifiedBy()`. Shared instances of a qualified binding are cached per qualifier class.

Qualifier

#qualifier

An attribute implementing the `Qualifier` contract that selects a qualified binding for a dependency. The qualifier's class is the key: it selects the binding, any value the attribute carries is ignored, and a qualifier class is unique to one binding outcome.

Query

#query

An expression that is a complete query, such as a select or an insert, rather than a fragment such as `col = ?`.

R

Read model

#read-model

An object carrying the fields one page needs, passed to a template in place of an entity.

Registrar

#registrar

A module's entry class, and the metadata reflected from it describing which of its methods do what.

Registry

#registry

The mutable counterpart of a catalogue, used while things are being registered. For example, configuration registrations are sealed into the configuration catalogue, and bindings and resolvers each have a registry alongside their catalogue.

Relative path

#relative-path

A path beneath a root, joined onto it by `Paths`. The root's trailing separator and the path's leading one are trimmed, so a path given with or without a leading separator produces the same result.

Resolution

#resolution

Producing an instance of a class through the dependency injection container, from a binding or automatically from its constructor. Also the object that describes such a request, holding details such as the class, any constructor arguments, a name or qualifier, and whether the result is lazy or liminal.

Resolution stack

#resolution-stack

The resolutions the dependency injection container is constructing eagerly, in the order it reached them. A resolution whose entry is already on the stack is circular.

Resolvable attribute

#resolvable-attribute

A parameter attribute that selects a custom resolver for the dependency it is placed on, paired with that resolver in the resolver catalogue. `Ghost`, resolved by `GhostResolver`, is one.

Resolver

#resolver

An object implementing the `Resolver` contract that resolves a dependency for the dependency injection container. A generic resolver handles dependencies by their type by default, and a resolvable attribute selects a custom resolver instead.

Result

#result

The rows returned by a query, fetched in full the first time any row is read and then kept.

Root

#root

An absolute directory under which the engine keeps one type of file. `Paths` holds the roots and joins relative paths onto them, and does not work out where they are, check that they exist, or create them.

Row

#row

One row of a result, holding its values keyed by column name, with typed accessors that cast a value and throw when it cannot be cast.

S

Schema statement

#schema-statement

An expression that is a complete schema statement, such as creating a table.

Scope stack

#scope-stack

The module scopes the dependency injection container currently has pushed, innermost last. It is emptied when a cycle closes.

Section

#section

The part of the configuration tree a configuration object is hydrated from. Dots separate the segments of a section path.

Shared

#shared

Describes an instance that the dependency injection container resolves once, caches, and returns on later resolutions for as long as its lifetime lasts, such as for the life of the worker or for one cycle. A transient instance is never shared.

Slot

#slot

A named point in a template that other code contributes to. A contribution receives the payload the template declares for the slot and nothing else.

Snapshot

#snapshot

The column data an entity was last loaded from or saved as, which saving compares against to find what changed.

Source chain

#source-chain

The registered template sources in precedence order, walked until a template reference resolves.

Statement list

#statement-list

The ordered statements one schema node compiles into, such as a table followed by its separate indexes and comments, executed in order inside one transaction. The exceptions are creating an index concurrently and creating a database, neither of which can run inside a transaction.

Store

#store

What finds, saves and deletes entities of one type, turning a row into an entity and an entity back into columns.

Superseded record

#superseded-record

A session record replaced when its identifier is regenerated, kept for a short configurable window so that requests already in flight still resolve.

T

Template namespace

#template-namespace

Who owns a template, such as `main` for core or `backups` for a module.

Template reference

#template-reference

A template's name in the form `namespace:path`, which names it without saying which file provides it.

Template source

#template-source

A named set of pairs, each mapping a template namespace to a path, registered as one unit. A later source wins over an earlier one.