Closed wimleers closed 9 years ago
@wimleers I love this suggestion! There is a similar issue on the SDK queue: https://github.com/d8-contrib-modules/cloudflarephpsdk/issues/12
Naive question: is there any major difference that you are aware of between Symphony and Drupal services/dependency injection.
Drupal == Symfony in this regard.
I've done some cursory research from what I can tell it makes the most sense to implement the service in CloudFlare rather than PHPSDK due to the dependencies on CMI.
Merged code in
Business Requirements
Technical Requirements
Background
This module currently very much uses a D7 pattern, of using
\Drupal::config()
(~variable_get()
) and then instantiating objects all over the place.Instead of exposing services that have their configuration injected, and those services can then be injected again, without every piece of code needing to retrieve the configuration and instantiate such an object again with that configuration.
Clear example of this: https://github.com/wimleers/cloudflare/commit/3281a7d74033b3ee2ab13834cd2bf24e327c62bc#diff-a35ab1b58293fa8fcf5e19b41a5f79e8L104.