Open
Conversation
2f89d34 to
31dab02
Compare
classes/auto_provisioner.php
Outdated
| foreach ($autoprovisionable as $tool) { | ||
| $class = $tool->get_tool_classname(); | ||
| if ($class::can_auto_provision()) { | ||
| $class::auto_provision($tool->get_client(get_config("watool_{$tool->name}"))); |
Contributor
There was a problem hiding this comment.
this feels pretty weird to me, we are settings up stuff specific to a tool, and then passing it into the tool. The tool should already know about itself this hints at a deeper issue.
I think there is a few things that can be simplified / avoided:
- let each tool manage its own client 100%, do NOT have a shared client_base. This feels like a premature optimization to me, and lets say we added support for Google analytics we would very likely use their SDK and this shared base just gets in the way
- so we don't need get_client() either, each tool does what it wants
- auto_provision() should take no arguments
- tool/matomo/classes/client.php will be a self contained class and not extend client_base (even extending curl I find weird but I'm ok with that)
31dab02 to
8fef6d1
Compare
8fef6d1 to
069fd06
Compare
This file contains hidden or 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
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.
#53