ActiveManage Docs ← Back to activemanage.co.uk

Configuration Sources

Configuration values come from two places: appconfig.php (a file on disk) and the database (rows in .config). Knowing which source wins for which kind of setting prevents surprises.

Resolution flow diagram: lookup setting key → check database first → if not present, fall back to appconfig.php → if not present, use code-level default → return value with source label

appconfig.php

  • A PHP file deployed alongside the application.
  • Edited by developers; changes go through git.
  • Best for: database credentials, encryption keys, environment-specific URLs, anything that's a deployment concern.
  • Restart not always required, but cache may need clearing.

Database (.config table)

  • Rows in the .config datastore.
  • Edited by administrators in the Site Settings UI.
  • Best for: business-tweakable values — email templates, branding, password policy thresholds.
  • Changes take effect immediately (or on next cache invalidation).

Resolution Order

  1. Database value (if present for the current scope: user → group → tenant → global).
  2. appconfig.php value.
  3. Code-level default.

Best Practices

  • Keep secrets out of the database. appconfig.php is the right place.
  • Keep environment-specific values out of the database. appconfig.php per environment.
  • Keep all business-tweakable values in the database so non-developers can change them.
  • Document each setting's preferred source.

Worked Examples

  • Stripe secret key: appconfig.php — sensitive, environment-specific.
  • Maximum login attempts: Database — admins tune this without redeploying.
  • Brand colour: Database — designer changes via the UI.
  • Database connection string: appconfig.php — environment-specific.
  • Welcome email template: Database — marketing edits the wording.