Configurations

Your application configuration files are located in ./config directory, every configuration file are represented by a simple PHP script which has to return array.

<?php
return [
    'modules' => [
        // Enabled Modules
        'MyModule',
    ],
    'module_manager' => [
        // Module Manager Specific Settings
        'modules_dir' => [
            PT_DIR_ROOT . '/Modules',
        ],
    ],
];

How configuration files works

Poirot relies on Modular design and each module can consist of specific configurations that default values could be overrided based on project.

All of the configuration files for the Project skeleton are stored in the configdirectory.

Take a look for routes for instance it's defined on HttpFoundation Module and overrided here on project skeleton.

override defaults by putting file here on config project directory
main file is here inside the module itself with default values

To make overriding config feature available should use load method from Config package. like this block of code from HttpFoundation

Accessing Configuration Values

You may easily access your configuration values using the global config helper function from anywhere in your application. config will return null if key/value not exists.

$cnf = config(\Module\HttpRenderer\Module::class, 'conf_key');

Last updated

Was this helpful?