APPNETOS is under active development This website and its documentation are being prepared for public launch. Content and features may change.
Select Theme
Loading

Configuration Reference

Complete reference for the shared, app, and admin configuration sections of APPNETOS.

These defaults are defined by the runtime configuration classes. Deployed platform configuration files and environment overlays may override them.

Configuration structure

Configuration values are placed under contexts.shared, contexts.app, and contexts.admin. Shared keys map to properties without a prefix; app and admin keys map to context-prefixed properties. Unknown properties are ignored, while recognized values are checked against their declared PHP types.

<?php

return [
    'contexts' => [
        'shared' => [
            // mongodb, redis
        ],
        'app' => [
            'app_cache' => true,
            'app_cache_expire' => 3600,
        ],
        'admin' => [
            'session_timeout' => 3600,
        ],
    ],
];

Configuration files are loaded from platform/config in this order: core defaults, core environment overlay, application defaults, application environment overlay. Values are combined with array_replace_recursive().

Shared configuration: MongoDB and Redis

MongoDB configuration is required for all runtime types, including command and worker processes. Redis configuration is validated structurally and may be used by cache and runtime services.

MongoDB

mongodb.uri and mongodb.database must be nonempty strings. mongodb.uri_options and mongodb.driver_options must be arrays. The MongoDB driver supports multiple hosts and replica-set options through these fields.

Redis

redis.prefix must be a string; redis.parameters and redis.options must be arrays. Predis receives the connection parameters and options; a cluster can be configured through the Predis-supported structure.

'shared' => [
    'mongodb' => [
        'uri' => 'mongodb://mongo1:27017,mongo2:27017,mongo3:27017',
        'database' => 'appnetos',
        'uri_options' => ['replicaSet' => 'rs0'],
        'driver_options' => [],
    ],
    'redis' => [
        'prefix' => 'appnetos',
        'parameters' => [
            ['scheme' => 'tcp', 'host' => 'redis1', 'port' => 6379],
            ['scheme' => 'tcp', 'host' => 'redis2', 'port' => 6379],
            ['scheme' => 'tcp', 'host' => 'redis3', 'port' => 6379],
        ],
        'options' => ['cluster' => 'redis'],
    ],
],

The values above illustrate a replica set and Redis cluster. Adapt hosts, credentials, topology and driver options to your infrastructure.

App context configuration

The app context controller inherits all configuration from Core\Config\Base without adding new properties. The following defaults are taken from the current shared base class.

Key Type Class default Behavior
database_session bool false Store sessions in MongoDB when enabled; otherwise use filesystem-backed sessions.
database_cache bool false Cache annotation-enabled database documents in Redis.
database_cache_expire int 3600 TTL for cached database documents, in seconds.
app_cache bool false Cache the complete multilingual rendered output of supported Apps. Cache hits bypass App execution.
app_cache_expire int 3600 TTL for cached App output, in seconds.
content_cache bool false Cache multilingual rendered content as static HTML. No TTL; the application must invalidate changed content.
content_element_cache bool false Cache multilingual rendered content elements as static HTML. No TTL; the application must invalidate changed elements.
file_cache bool false Cache resolved class-file paths so the autoloader does not need to search for them repeatedly.
directory_cache bool false Cache directories used by the autoloader.
translation_cache bool false Consolidate translations into a cache file and extend it when additional translations are loaded.
js_cache bool false Cache App JavaScript resources as generated files with unique hashed filenames; cache clearing generates new names.
js_minify bool false Minify JavaScript in the DOM and when generating cached resources.
css_cache bool false Cache App CSS resources as generated files with unique hashed filenames; each App has separate generated resources.
css_minify bool false Minify CSS resources.
twig_cache bool false Enable the Twig template cache.
compressor bool false Remove unnecessary whitespace and empty lines from rendered output.
rest_cache bool false Cache resolved REST resource registry metadata to avoid repeated collection discovery and annotation reflection.
pass_regex string '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).{8,}$' Regular expression used to validate passwords.
encrypt_ip bool false Control whether user IP addresses are stored/read in encrypted form rather than plaintext.
session_timeout int 2592000 Session lifetime, in seconds.
session_persistent bool true When enabled, set a persistent SESSION cookie for the configured session timeout; otherwise use a browser-session cookie.
clear_all_caches_parameter string 'appnetos-clear-cache' GET query parameter name used to trigger clearing of all caches.
statistics bool true Enable context-specific statistics recording; may increase MongoDB storage usage significantly.
mailer array|null null Default mailer configuration for this context; null disables the configured default mailer.

Admin context configuration

The admin context declares its own settings. In particular, app_cache, content_cache and content_element_cache are not admin settings.

Key Type Class default Behavior
database_cache bool false Cache annotation-enabled database documents in Redis.
database_cache_expire int 3600 TTL for cached database documents, in seconds.
file_cache bool false Cache resolved class-file paths so the autoloader does not need to search for them repeatedly.
directory_cache bool false Cache directories used by the autoloader.
translation_cache bool false Consolidate translations into a cache file and extend it when additional translations are loaded.
js_cache bool false Cache App JavaScript resources as generated files with unique hashed filenames; cache clearing generates new names.
js_minify bool false Minify JavaScript in the DOM and when generating cached resources.
css_cache bool false Cache App CSS resources as generated files with unique hashed filenames; each App has separate generated resources.
css_minify bool false Minify CSS resources.
twig_cache bool false Enable the Twig template cache.
compressor bool false Remove unnecessary whitespace and empty lines from rendered output.
rest_cache bool false Cache resolved REST resource registry metadata to avoid repeated collection discovery and annotation reflection.
clear_all_caches_parameter string 'appnetos-clear-cache' GET query parameter name used to trigger clearing of all caches.
pass_regex string '^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^a-zA-Z0-9]).{8,}$' Regular expression used to validate passwords.
encrypt_ip bool false Control whether user IP addresses are stored/read in encrypted form rather than plaintext.
database_session bool false Store sessions in MongoDB when enabled; otherwise use filesystem-backed sessions.
session_timeout int 3600 Session lifetime, in seconds.
session_persistent bool true When enabled, set a persistent SESSION cookie for the configured session timeout; otherwise use a browser-session cookie.
statistics bool true Enable context-specific statistics recording; may increase MongoDB storage usage significantly.
mailer array|null null Default mailer configuration for this context; null disables the configured default mailer.

Caching and invalidation

Static content caches

content_cache and content_element_cache store multilingual static HTML without a TTL. Applications must invalidate these caches whenever the underlying content changes.

Rendered App output

app_cache caches the complete multilingual rendered result of supported Apps. On a hit, the App does not execute again. Not every App supports this feature. app_cache_expire controls its TTL.

JavaScript and CSS

With asset caching enabled, per-App JavaScript and CSS files are generated using unique hashed filenames. Clearing the cache removes generated assets; rebuilding creates new filenames so browsers request the updated resources. css_cache_separate_files is obsolete and is not a supported setting.

REST registry

rest_cache caches REST resource registration metadata and avoids repeated discovery and annotation reflection. It is not a generic cache for arbitrary HTTP API responses.

Sessions and security

database_session selects MongoDB-backed sessions when enabled, or filesystem-backed sessions when disabled. session_timeout controls the session lifetime in seconds. With session_persistent = true, the SESSION cookie is persistent for the configured timeout; when false, it is a browser-session cookie.

pass_regex defines the password validation expression. encrypt_ip controls IP-address encryption. statistics enables context-specific statistics recording, which can create significant MongoDB storage usage.

Mailer configuration

The mailer setting is an array or null. A null value means there is no configured default mailer for the context. The mailer supports SMTP, PHP mail() and Sendmail. SMTP requires a sender email address, host and valid port; authentication additionally requires username and password.

Mailer key Type Meaning
transport string smtp, mail, sendmail
email string Required sender address
name string|null Optional mailer name
sender_name string|null Sender display name
host string|null SMTP host; required for SMTP
port int SMTP port; configuration class default 25
user string|null SMTP authentication username
pass string|null SMTP authentication password
timeout int Transport timeout in seconds; class default 30
smtp_auth bool Enable SMTP authentication
smtp_secure string|null ssl, tls, or null
ignore_certificate bool Disable certificate and hostname verification
sendmail_path string|null Optional Sendmail executable path
header_content_id string|null Optional header content ID
footer_content_id string|null Optional footer content ID

SMTP example

'mailer' => [
    'transport' => 'smtp',
    'email' => 'noreply@example.com',
    'sender_name' => 'APPNETOS',
    'host' => 'smtp.internal',
    'port' => 465,
    'smtp_auth' => true,
    'user' => 'smtp-user',
    'pass' => 'replace-with-secret',
    'smtp_secure' => 'ssl',
    'ignore_certificate' => false,
],
Internal SMTP and certificate verification

ignore_certificate = true disables TLS certificate and hostname verification. This may be useful when connecting to another VM through its private IP and the certificate hostname does not match. Prefer a trusted certificate and a matching internal hostname when possible, especially in production.

For mail and sendmail, SMTP-specific host and authentication values are not required. Sendmail may use sendmail_path.

Production considerations

Change clear_all_caches_parameter from the default appnetos-clear-cache before production deployment. For example, a configured parameter can be triggered using ?your-cache-clear-key=1. Treat access to this operation as security-sensitive.

Enable appropriate caches for production, establish cache invalidation in applications that manage content, use trusted database and mailer connections, and review statistics storage requirements. The api configuration key and the former css_cache_separate_files key have been removed and are intentionally absent from this reference.

Next Steps

Previous

Configuration Files & Loading

Explore Configuration Files & Loading

Next

Custom Configuration & Installation

Explore Custom Configuration & Installation