Skip to content

Setup: Multi Project

dante di domenico edited this page Dec 22, 2021 · 1 revision

Enable multi project in BEdita Manager

  • in config/projects create a .php configuration file for each project - those files are not under version control

  • the configuration file name can be anything you like, it will not be used or displayed anywhere

  • look below for an example, in this file you can override almost any configuration key and define new ones with the exception of some keys consumed at bootstrap:

    • 'Cache'
    • 'Datasources'
    • 'EmailTransport'
    • 'Email'
    • 'Log'
    • 'Security.salt'
  • on the login page a select is displayed to choose a project, after login project configuration file is always loaded from ProjectMiddleware on every page/request

Project configuration file example

return [

    /**
     * Project name.
     * [MANDATORY]
     */
    'Project' => [
        'name' => 'My Project',
    ],

    /**
     * API configuration.
     * [EXTREMELY RECOMMENDED]
     */
    'API' => [
        'apiBaseUrl' => 'https://my-api-endpoint',
        'apiKey' => 'my-api-key',
        // 'log' => [
        //     'log_file' => LOGS . 'api.log',
        // ],
    ],

    /**
     * Modules configuration.
     * [RECOMMENDED]
     */
     'Modules' => [
       // modules conf here
     ],

    /**
     * Properties display configuration settings.
     * [RECOMMENDED]
     */
    'Properties' => [
       // properties conf here
    ],

    /**
     * Plugins.
     * [OPTIONAL]
     */
    'Plugins' => [
       'MyPlugin' => ['autoload' => true, 'bootstrap' => true, 'routes' => true, 'ignoreMissing' => true],
    ],
];

What is a Project?: a project in BEdita is an independent data set consisting mainly of objects, resources and media files; you may think of a database with a set of related resources like media files and configurations; each project will expose its own endpoints to applications