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

Platform Configuration

How APPNETOS loads, validates, installs, and applies platform configuration across applications, environments, and runtime contexts.

APPNETOS uses a shared configuration controller with context-specific settings. Global configuration establishes infrastructure and defaults; application and environment files can override those values. The active configuration is loaded from platform/config/.

Configuration Model

Core\Config\Base is the shared configuration implementation. The app context inherits its configuration properties directly from the base class, while the admin context defines additional admin-specific properties. Configuration values are mapped from the contexts sections to typed PHP properties and validated before use.

Section Responsibility Examples
contexts.shared Common runtime infrastructure and configuration MongoDB, Redis
contexts.app Application-facing runtime behavior App and content caching, sessions, mailer, assets
contexts.admin Administration runtime behavior Admin caching, sessions, mailer, security settings

Not every setting is available in every context. In particular, rendered App caching and static content caching are app-specific; they are not admin configuration options.

Configuration Loading

APPNETOS loads the base configuration first, then applies environment and application-specific overlays. Later files take precedence through array_replace_recursive().

  1. platform/config/appnetos.php
  2. platform/config/appnetos.<environment>.php
  3. platform/config/<application>.php
  4. platform/config/<application>.<environment>.php

Only existing files are loaded. At least one global APPNETOS configuration file is required; application-specific files are optional. Environment names are resolved from the active runtime.

<?php

return [
    'contexts' => [
        'shared' => [
            'mongodb' => [
                'uri' => 'mongodb://localhost:27017',
                'database' => 'appnetos',
                'uri_options' => [],
                'driver_options' => [],
            ],
            'redis' => [
                'prefix' => 'appnetos',
                'parameters' => ['scheme' => 'tcp', 'host' => 'localhost', 'port' => 6379],
                'options' => [],
            ],
        ],
        'app' => [
            'twig_cache' => false,
        ],
        'admin' => [
            'session_timeout' => 3600,
        ],
    ],
];

Example only. Configure MongoDB and Redis for the actual environment; do not copy local development connection values into production without review.

Installation and Runtime Configuration

Installation resources and active runtime configuration serve different purposes. During application installation, APPNETOS prefers custom/<application>/.files/platform/ when that directory exists; otherwise it uses the application's packaged platform resources. The selected source is copied to the shared platform/ directory.

Custom source behavior

The custom installation directory replaces the packaged source as a whole; it is not a partial overlay. Normal installation preserves existing destination files. Reinstallation overwrites destination files present in the selected source, but does not remove unrelated files.

At runtime, configuration is read exclusively from platform/config/, not directly from the application's custom installation directory.

Documentation

The Platform Configuration reference is organized into four detailed pages. Read them in order for the full configuration workflow, or open the topic relevant to your task.

Key Principles

  • One loader: APPNETOS applies the same configuration loading and validation rules across runtime environments.
  • Explicit contexts: Shared, app, and admin properties are distinct and type-checked.
  • Layered configuration: Application and environment overlays override common defaults in a predictable order.
  • Separated installation: Custom installation resources are deployed before they become runtime configuration.
  • Operational control: Cache invalidation, secrets, database access, and long-running worker processes must be considered during deployments.

Next Steps

Configuration Files & Loading

Explore Configuration Files & Loading

Configuration Reference

Explore Configuration Reference

Custom Configuration & Installation

Explore Custom Configuration & Installation

Development & Production

Explore Development & Production