What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hello. I have a question about configuration. Is it a bad practice to use config values from other m
Hello. I have a question about configuration. Is it a bad practice to use config values from other modules *Config.php?
Should we provide config values through facade methods to use them from different module?
Comments
-
I would say, it's ok to have direct references at project level
0 -
this should be taken into account as a part to check on future updates though. You can expect compatibility on facade methods level, but not for underlying code which could be modified even in minor releases
0 -
returning config values through facade is an overkill. Usual flow is that you define a config in both modules and wire them up together in config.php. We have this all over spryker i.e.
$config[ApplicationConstants::ZED_TRUSTED_HOSTS] = $config[HttpConstants::ZED_TRUSTED_HOSTS] = [];
0 -
Thank you very much for clearing that up! π
0 -
@UKHD8KTMF won't config.php get bloted in this case and we'll need to create separate configs?
maybe it's better then to use it directly how @ULSLLNL7K told π0 -
Well, you asked about the good practice. Maybe the better question is if your modules are really independent if they are sharing a config? Maybe the caller should send a transfer (business object) with all needed data. I would not refer to other module configuration. This makes them tightly coupled.
0 -
Good tip, I'll have to re-evaluate that they are really independent.
0 -
Looks like spryker does not have standards here also
/** * @see \Spryker\Shared\Price\PriceConfig::PRICE_MODE_NET */ public const PRICE_NET_MODE = 'NET_MODE';
in this case the constant is redefined everywhere which I don't think is a good idea, alhough maybe constants like this are not likely to change π€·ββοΈ
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random