search hotlink icon profile hotlink icon
ma Public | 1.x.x

On This Page

Extensions Structure

Maze uses Fusion's out-of-the-box extension implementation to handle configs files, defined in the fusion.json metadata as follows:

                {
    "id": "valvoid/maze",
    "structure": {
        "/configs": "extension"
    }
}
            

The extension directory indicator marks /configs as an extension point, where subdirectories named after each extender package identifier are automatically managed by Fusion.

For example, consider a package using Maze as a router with the following fusion.json metadata:

                {
    "id": "extender/package",
    "structure": {
        "/dependencies":  "valvoid.com/valvoid/maze/1.0.0"
    }
}
            

As a result, Maze is added as a dependency at /dependencies/valvoid/maze and extended at /configs with the /extender/package subdirectory, which contains the config.php file:

                /dependencies
    /valvoid/maze/configs
        /extender/package
            config.php
            

Load Order

Package Identifiers

Maze loads the /extender/package subdirectories in top-down order as defined in the extensions.php file, which Fusion automatically generates in the cache directory. This file contains a sequential array where each index indicates a package's position in the build or replicate chain:

                return [
    "/configs" => [
        // ordered package identifiers
        1 => "extender/package",
        3 => "other/extender/package"
    ]
];
            

Multiple Files

Within a single /extender/package, config files can be organized in nested subdirectories. Maze loads all files alphabetically.

For example:

  • 1. /any/more_config.php
  • 2. config.php
  • 3. whatever_config.php