-
Notifications
You must be signed in to change notification settings - Fork 17
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
socket unix not allowed in constructor #3
Comments
Hey, thanks for the suggestion, @jferran95. I can definitely add socket as an option to the constructor. I think it might be better to make it into a key-value array now. Can you please clarify your second point for what you're looking for in terms of design change? |
Still testing. Need to evaluate first. But before that I saw a relevant issue with the design. This component takes the responsibility to open a connection. That is a huge no thanks. That is a sensitive feature. Due to security it is nice to hide. Another black box [component] will provide a connection. Dealing with user authentication, connection persitence, pooling, load balancing, targeting multiple databases (batch processes). This component in order to be simple, must give up on that responsibility. For instance I modified it just for testing purposes (evaluation):
So a php-framework provides the connection. And this component works on top, as a mere wrapper. Will have more insight about the design after using it for days. |
Ah, ok, I understand you. Ya, I agree it would be better to use dependency injection. I'd be happy to make this change. |
I do not see a way to open a connection using a socket (unix).
It seems the constructor is closed to using hostname and port.
It is interesting to respect the use of a socket (allowed in mysqli).
You can also think changing the design to allow use of an externally created connection.
The component can delegate unto others, like an external framework, to host the top level configuration, handling of a connection-pool, redundancy or whatever new features appear.
So it is better suited for integration with others projects. To use this component as a thin abstraction layer on top of mysqli (connection).
The text was updated successfully, but these errors were encountered: