Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #6854
Closed
Open
Issue created Jul 03, 2020 by Administrator@rootContributor

[REQ][php-slim4] Move config to a separate file

Created by: ybelenko

Is your feature request related to a problem? Please describe.

I've used current Slim4 server in my personal project and I think that config file should be extracted from index.php. The most suitable format is config.inc.php.

Describe the solution you'd like

I'll add config folder with example.inc.php. User should copy that file to prod.inc.php and dev.inc.php. I prefer config.inc.php format over .env and .ini because these formats can be used only for flags or string variables. So config.inc.php file is the only way if you need to specify callback:

return [
    'getPDOConnection' => function () {
        return new PDO('mysql:dbname=dbname;host=localhost;charset=UTF8', 'root', 'root');
    },
];
Assignee
Assign to
Time tracking