New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ECOMMERCE] Migrate to symfony configuration #1783
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lass declarations
…c tracker interface as they are enhanced ecommerce specific
…ilder() method from Tracker interface Constructor will differ by implementation, tracking item builder does not need to be accessed from outside.
…able via options and simplify template rendering
…nt of config, just accept a list of tracker instances
…g manager together via config + container
…face and implementation
…lly when resolving locale
… (in-memory) and a SessionEnvironment and load session data lazily Does not load session data upon construction, but on first access.
…a symfony config + container
…fig tree The config tree expects at least a "default" tenant entry. To define default values which are used in every tenant, a special _defaults tenant entry can be used which will be merged into every tenant at normalization.
…ndent of config Carts and price calculators are built by factories which are kept as dependency by the cart manager. The cart manager itself is tenant specific.
…cart and price calculator factories per tenant Factory::getCartManager() will return the cart manager matching the current environment.
…ust to fetch the session
…ined via config + container Simple options are handled via OptionsResolver, environment and voucher services are injected as dependencies. Agent is now built through a dedicated agent factory which is added as dependency.
… defined via config + container
… order manager, cart manager and voucher service toghether via container
… via factory options
…c token managers from Factory to a dedicated TokenManagerFactory
…on tree with support for tenants and placeholders
…s and make default implementation valid Default implementation did not return an availability, but the concrete product instead. Now a simple availability value object is returned. AttributeAvailabilitySystem was renamed to AvailabilitySystem as it does not handle any attributes.
…ependent of factory and config
…for price and availability systems and register them on factory Ecommerce framework does not handle any options for price and availability systems. Instead the config expects service IDs which are wired into the factory through a Symfony service locator containing only the configured price/availability systems indexed by name.
…nager being bound to the same tenant Services relying on each other are resolved from the factory at runtime instead of being injected statically. This makes instances less predictable but restores existing behaviour and allows to handle different tenants for different components.
…olve depenent services through service locators Instead of injecting the factory as done in the previous commit, inject a component specific service locator (e.g. IOrderManagerLocator) which can resolve the order manager from the environment when requested.
…locators - build them in extension instead
maff
changed the title
[ECOMMERCE] Migrate to symfony configuration
WIP: [ECOMMERCE] Migrate to symfony configuration
Aug 1, 2017
…zed mysql index worker
…le and for legacy class mapping
… on signature changes)
maff
changed the title
WIP: [ECOMMERCE] Migrate to symfony configuration
[ECOMMERCE] Migrate to symfony configuration
Aug 2, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1646
General concepts:
Factory::getInstance()->getVoucherService()
somewhere inside theOrderManager
, the order manager requests anIVoucherService
constructor argumentPaymentManager
just gets a set of providers it can access by nameThis removes configuration/dependency resolving logic from each component to the extension/configuration, which makes the components itself more predictable, thus easing debugging and testability.
Configuration for components supporting tenants is not split into a general and a tenants section anymore, but defines everything inside a
tenants
section, defaulting to adefault
tenant. Inside the config, inheritance can be achieved by defining a special_defaults
tenant which is merged into every defined tenant.