Skip to content
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

Allow scan directories to be Profile aware #407

Open
cspray opened this issue Mar 15, 2025 · 0 comments
Open

Allow scan directories to be Profile aware #407

cspray opened this issue Mar 15, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@cspray
Copy link
Owner

cspray commented Mar 15, 2025

Annotated Container is intended to be a fully-featured dependency injection container. That means, providing testing utilities to help with integration and acceptance testing using the container. With this type of testing it could be desired to change or alter services based on being in a testing profile; consider a LoggerInterface that outputs to normal locations in dev, but uses testing implementations if in test. While this works out-of-the-box, if the directory the test logger is in is not present or the autoloader does not include dev dependencies, a likely occurrence in production environments, a problem is encountered. Ultimately, if we scan a service, in this case a test logger, it must be loadable and it isn't.

Realistically, the only way to deal with this problem is to simply not scan the directory with the test service when you're in a profile that doesn't need it. This would also have the benefit of reducing the amount of files needing to be scanned when running in production environments.

This is a fairly significant change; more than 1 corresponding piece will need to be made profile-aware and a former list of scalar strings must now become a complex object capable of holding multiple pieces of information; the directory and any profiles it may be associated with.

@cspray cspray added the enhancement New feature or request label Mar 15, 2025
@cspray cspray added this to the v3.0.0 Release milestone Mar 15, 2025
@cspray cspray self-assigned this Mar 15, 2025
@cspray cspray moved this to Todo in Annotated Container Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant