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

Server URL Helper Cleanup #159

Closed
wants to merge 2 commits into from

Conversation

gsteel
Copy link
Member

@gsteel gsteel commented Mar 24, 2022

Description

Deprecates all methods in the server url helper and introduces a factory to provide the helper with the detected or configured host URI.

Brings in a hard dependency on laminas-diactoros in order to re-use the functions for detecting the host/port from the environment that are already present there.

Doesn't break BC according to tests, and also doesn't alter existing behaviour for long-running apps because the previous implementation caches the host/port in instance properties anyway.

The main improvement here is that consumers can configure the desired host and port without any attempt to figure it out from the environment which is particularly useful on the CLI or any other time when the required env vars are either wrong or not there at all.

The introduction of the factory is a potential BC break because an exception is thrown when there is neither configuration, nor usable env vars.

gsteel added 2 commits March 24, 2022 16:24
- Deprecate all methods and properties in the server url helper
- Introduce constructor to provide the helper with a configured url
- Deprecate existing tests to make them easy to remove in future

Signed-off-by: George Steel <[email protected]>
Adds laminas-diactoros as a dependency so that detection of the host URI can be delegated to existing code

Signed-off-by: George Steel <[email protected]>
@gsteel gsteel closed this Mar 24, 2022
@gsteel gsteel deleted the helpers/server-url-cleanup branch March 24, 2022 16:59
@gsteel gsteel restored the helpers/server-url-cleanup branch March 24, 2022 20:44
@gsteel gsteel reopened this Mar 24, 2022
@gsteel
Copy link
Member Author

gsteel commented Mar 27, 2022

Closing - This is a duplicate of #160 - I got all messed up with GHA being down

@gsteel gsteel closed this Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants