-
Notifications
You must be signed in to change notification settings - Fork 83
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
Not possible to create multiple Piwik tracker instances having different API urls #42
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think $URL should override $this->trackerUrl? I'm thinking of the following situation:
Actually I'm not too sure how to fix this... Maybe there needs to be two properties,
$originalTrackerUrl
set in the constructor and$trackerUrl
set by the method. Where$trackerUrl
overrides everything, but if not set,self::$URL
is used? This isn't as simple as I thought it was...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm not sure either. That's why I mentioned BC and being difficult. The problem is the next tracker creation
new Tracker()
would also call::$URL = '...'
and overwrite that... was thinking to removeself::$URL = ...
in constructor but then we regress there. Not sure what is used more than the other... maybe we need to wait for Matomo 4 with this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we could add an options parameter like this:
And maybe issue a warning or notice when doNotUseGlobalUrl isn't set to true?
Then in Matomo 4 we get rid of the option. At least this way, the bug doesn't cause problems in the meantime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't we need to set it to
false
by default re BC? Users wouldn't be aware they need to change this parameter when they update (even when we mention it in changelog it would go mainly unnoticed). But at least with the option there be a way to restore old behaviour. Let's see what @mattab thinksThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, would need to be false by default. I think this solution would mostly be for us not running into it, though if we could issue a warning of some kind w/o causing any issues, users might notice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but don't know what is the best solution here. But sounds good to throw a warning to help people notice their code might be mis-behaving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tsteur any new thoughts on this conversation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't do anything before Matomo 4 I reckon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll remove this from the current sprint.