Configuration

The config layers, and every key the framework reads.

Layers

Config merges in this order, later wins:

  1. phlat/config.json, the framework's defaults
  2. site/config.json, your site
  3. site/data/env.json, this deployment's secrets and overrides (gitignored)
  4. site/data/env.cli.json, merged on top for CLI runs only (gitignored)

Read a key with dot notation, in code or in a template:

$app->config->get('images.quality');
$app->config->get('analytics', []);

site/config.json can hold any key your site needs, such as analytics or themes. An addon keeps its own settings under its addons.{id} entry and reads them with $app->addonConfig('phlat/admin', 'key'), or {addon('phlat/admin', 'key')} in Latte.

Keys

Key Default Meaning
timezone UTC The site's time zone for display. Stored timestamps are always UTC
debug false Show exception details on error pages, recompile templates when they change, turn on Clockwork, and skip the fragment cache
session.expire 86400 Seconds of inactivity before a session ends. 0 leaves it to PHP. Activity is recorded at most once a minute
fieldtype.code.theme one-dark-pro The Phiki theme code fields highlight with. A field's theme option or ->highlight($theme) overrides it per render. Highlighted output is cached by its code, language and theme
images.driver imagick imagick or gd
images.quality 80 Default encode quality, overridden by quality=
images.presets none Named option strings for src(). See Images
images.drawings none Named draw layers for draw() and drawLayers(). See Images
options.{key} none A visitor option: a list of allowed string values, the first the default. See Routing
files.cache public, max-age=3600 Cache-Control for public files
files.cache_max_bytes 5000000 A file larger than this is sent no-store
media.allowed common images, pdf, mp4, webm, mp3, zip Extensions an upload may have
uuid.length 8 Length of a new uuid, from 8 to 16
dateTimeFormat F j, Y The default date format
git.message {objecttype}/{type}:{action}({path}) History's commit message. See History
email.default smtp://mailpit:1025 The DSN $app->email() sends through. email.{name} adds more transports
addons.{id} see the file enabled, mount, and the addon's own settings. See Addons

Secrets belong in site/data/env.json, which stays out of git and survives redeploys with the rest of site/data/.