Hello people, I've read as much as I could on the subject but I'm still a bit confused.
When developing ZF2 modules that need an internal configuration, I see as a common practice to either rely on the usual array in module.config.php or use AbstractOptions concrete implementations with explicit accessors for each value, often instantiated from the config array itself (premium examples: ZfcUser and Doctrine modules). So far so good, I get that AbstractOptions makes configurations much more self documented, but then I wonder, what's the Config class for? They implement different interfaces, I see that, but from a use case standpoint, what's the difference? To be more precise, is there any difference between the two when dealing with dynamically assigned values, i.e. merged data from a persistence layer? The particular use case I'm interested in is an opt-in feature, where by default the module can work without any persistence service and only rely on the autoloaded config files, but can optionally enable some features that require those options to be loaded from said persistence layer. So which of the mentioned classes is ideal for the job? More to the point, are they both meant to be modified runtime in the first place? So far I've only seen read-only usages of AbstractOptions, in comparison Config is rarely used, which is strange because as far as I understand Stdlib class were primarily meant to be used internally by the framework. TL:DR; what would you recommend between the two for dynamic module configuration? Thanks in advance. Stefano Torresi
