How does the config file inheritance work?

andreas.fluer
andreas.fluer Spryker Customer Posts: 5 🧑🏻‍🚀 - Cadet

Is it something like this?

  1. config/Shared/config-default.php
  2. config/Shared/config-default_{store}.php
  3. config/Shared/config-default_{environment_name}.php
  4. config/Shared/config-default_{environment_name}_{store}.php

Or is it only using ?

  1. config/Shared/config-default_{environment_name}.php
  2. config/Shared/config-default_{environment_name}_{store}.php

Is there anywhere a documentation for this, because I can not find any…

Best Answer

  • ynnoig
    ynnoig Technical Lead eBusiness Spryker Customer Posts: 13 ✨ - Novice
    Answer ✓

    Just take a look here → \Spryker\Shared\Config\Config::init

Answers

  • ynnoig
    ynnoig Technical Lead eBusiness Spryker Customer Posts: 13 ✨ - Novice
    Answer ✓

    Just take a look here → \Spryker\Shared\Config\Config::init

  • andreas.fluer
    andreas.fluer Spryker Customer Posts: 5 🧑🏻‍🚀 - Cadet
    edited March 8

    Thanks @ynnoig!

    For everyone newbie like me:

    The config files are imported in this order according to the accepted answer!

    1. config/Shared/config-default.php
    2. config/Shared/config-default_{environment_name}.php
    3. config/Shared/config-default_{store}.php
    4. config/Shared/config-default_{environment_name}_{store}.php
    5. config/Shared/config_local_test.php
    6. config/Shared/config_local.php
    7. config/Shared/config_local_{store}.php
    8. config/Shared/config_propel.php

    Cheers Andy!

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 58 🪐 - Explorer
    edited March 11

    Hi @andreas.fluer , just a slight, nitpicky, correction to the numbers 3, 4 and 7:

    The config loaded there is not necessarily the store (even if it is so by default) but the Codebucket, which happens to be mapped to the Store by default: https://docs.spryker.com/docs/dg/dev/architecture/code-buckets.html#code-buckets-and-stores

    (I just happen to be integrating the Dynamic Multistore feature, and this is one of the things we need to resolve :) )