Skip to content

Configuration reference

Everything you can configure in Melis, in one place: environment variables, the platform file, the app.*.php config family, melis keys, translations, assets and caches.

Environment variables

Two variables drive every install (set in docker-compose.yml, or via Apache SetEnv):

VariablePurpose
MELIS_PLATFORMSelects the platform config config/autoload/platforms/<MELIS_PLATFORM>.php (the DB connection). E.g. local, dev1.
MELIS_MODULEThe site module served as front office for this domain (e.g. MelisDemoCms).
MYSQL_HOSTNAME / MYSQL_DATABASE / MYSQL_USER / MYSQL_PASSWORDDB connection, usually read by the platform file via getenv().

The platform file

config/autoload/platforms/<MELIS_PLATFORM>.php holds the database connection (and a few host settings). It's merged last, so it overrides defaults per environment:

php
return [
    'db' => [
        'driver'   => 'Mysqli',
        'hostname' => getenv('MYSQL_HOSTNAME') ?: 'localhost',
        'database' => getenv('MYSQL_DATABASE'),
        'username' => getenv('MYSQL_USER'),
        'password' => getenv('MYSQL_PASSWORD'),
        'port'     => '3306',
        'charset'  => 'utf8mb4',
    ],
    'melis_platform'       => getenv('MELIS_PLATFORM'),
    'melis_http_host'      => 'localhost',
    'melis_request_scheme' => 'http',
];

The file loaded is chosen at config/application.config.php (config_glob_paths) from getenv('MELIS_PLATFORM').

Project config files

FileRole
config/melis.module.load.phpThe ordered list of backoffice modules to load.
config/melis.modules.path.phpGenerated map: module name → filesystem path (built by MelisAssetManager).
config/application.config.phpApp entry: module assembly, glob paths, cache flags.
config/autoload/{global,local}.phpStandard Laminas autoload config.
config/autoload/platforms/<env>.phpPer-environment DB/platform config (above).
config/development.config.phpDev overrides (created by laminas-development-mode enable).

The app.*.php config family

Each backoffice module merges these Melis-specific files in Module::getConfig(). They all build a single tree under a plugins root, queryable via MelisCoreConfig:

FileDeclares
app.interface.phpUI zones and their forward (module/controller/action). Each node: conf (id, name, icon, melisKey, rightsDisplay), forward, nested interface.
app.toolstree.phpWhere a tool attaches in the left menu (*_toolstree_section).
app.tools.phpTools: data tables (columns, filters, action buttons), forms.
app.forms.phpReusable form definitions (Laminas form spec + input_filter).
app.emails.phpEmail template configs.
app.microservice.phpCallable service-method APIs (input/output forms).
excluded.routes.phpRoutes that bypass the auth check.

Conventions

  • Translation keys: tr_<module>_<section>_<item> (e.g. tr_meliscore_tool_users).
  • Config ids: id_<module>_<item>.
  • Melis keys: short aliases declared as 'conf' => ['melisKey' => '…'] → resolved to full config paths by MelisCoreConfig::getMelisKeys().
  • Tables: melis_<area>_<entity> (e.g. melis_core_user, melis_cms_page_published, melis_ecom_product).
  • Routes: <module-slug>/<name> (e.g. melis-backoffice/login).

Translations

Per-locale PHP arrays under each module's language/:

language/en_EN.interface.php
language/fr_FR.interface.php   // 'tr_key' => 'Texte'

Loaded by Module::createTranslations() for the active locale (session melis-lang-locale), with en_EN as fallback. Types include interface, forms, install, setup.

Assets

MelisAssetManager serves each module's public/ folder at /<ModuleName>/… and generates config/melis.modules.path.php. A site module lists its front-office CSS/JS in config/assets.config.php. Webpack bundling is available (build tool / backoffice action).

Caches

Cache behaviour is configured in melis-core's module.config.php (the caches section) and used via MelisCoreCacheSystemService. Each cache has an active flag, a cache_dir under cache/, and per-key TTLs. The Laminas config cache is governed by config_cache_enabled in application.config.php (off by default in this skeleton). See Troubleshooting for clearing caches.

Where to look

ConcernPath
Module listconfig/melis.module.load.php
Platform DBconfig/autoload/platforms/<MELIS_PLATFORM>.php
Config servicevendor/melisplatform/melis-core/src/Service/MelisCoreConfigService.php
Cache configvendor/melisplatform/melis-core/config/module.config.php (caches)
Asset managervendor/melisplatform/melis-asset-manager/