Skip to content

Only dev *or* prod config, not both #225

Closed

Description

@g105b

Sometimes it's useful for the code to know whether we're in dev or prod mode. Currently, there is no way to know which mode we're in.

On the development environment, there can be an optional config.dev.ini that will override the default values in the config.ini. The expectation is that the dev ini does not get checked into version control, as this is where the actual keys and secret values will lie.

However, on dev it might be that you use "mock" versions of API keys, or have specific low-exposure keys generated for each developer. When the code gets to production, it would (and should) always be an error if the dev ini was found on the production server.


Proposed changes:

  1. throw an exception if there are both dev and prod at the same time.
  2. assume "prod" by default (for security reasons), so things like $config->isProduction() will return true, and only assume "dev" if there is a config.dev.ini, or app.production=false. This will mean that assuming prod by default can apply more strict security / not bundle source maps / etc.

Activity

  1. added
    enhancement
    on Oct 3, 2025
  2. added theissue type on Oct 3, 2025
  3. g105b commented on Mar 16, 2026

    @g105b
    MemberAuthor

    It would be nice to have a config.staging.ini too, and treat this with the same rules - only one of dev, staging, production.

  4. g105b commented on Nov 10, 2026

    @g105b
    MemberAuthor

    While we're at it, we should have synonyms: dev/development, stag/staging, prod/production - and these should also throw the same exception if there is more than one loaded.

  5. self-assigned this
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions