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
Namespace branch and namespace #8
Comments
I have created a For the namespace, including |
I picked "Php" up from the repo name (and intended it mostly to start a conversation), but you're right that it's implied by the time we define a PHP namespace. I suppose there are a couple of points worth making:
I'd certainly prefer:
I also think it's worth noting that the legacy code provides server-side tracking. It's certainly possible to add the API-supported request for client-side tracking code (as, for example, WP-Piwik currently implements). If we prepare for this possibility, we might use a class more like All together this would produce the less concise (but more explicit) |
I don't understand what you mean by "server side"? The goal here is to use the tracking API, whether it's from a JS client or PHP client doesn't really matter? |
Certainly both use the Tracking API. It seems to me that we'd want different classes for the two cases:
I think of this as server-side and client-side tracking because I work mostly in the web analytics use case. Rather than beg the question... do you agree that these are different classes? If so, what distinction is consistent with the broader set of use cases? I'm not picky... but it'll be really hard to change once there's a base of users so I'm trying to anticipate potential issues. |
Getting the JS tracking code is currently not covered by the tracker client, this is probably a problem that can solved later on (wether the method is on the main class or not). It could also be done on the Reporting Piwik client (currently a separate thing, could be merged with this one eventually). The things we might want to have in a first version could be:
|
We seem to be talking past one another. I'm obsessing about namespaces\classnames because they're hard to change after-the-fact. I'm also 2 steps ahead because the ZF2 module I reference above (and maintain) already includes FQNs Let me break my proposal into pieces so we can identify any points of disagreement:
My goal is a Piwik-approved naming convention that covers all of these cases so my ZF2 client stays in sync. Obviously, it also makes sense for me to push code back upstream to this client so it'd be helpful to know where to put JS stuff. |
The difference you see in "php tracker" and "js tracker" doesn't exist in this project (yet) :) What I suggested is basically "keep the features, refactor the implementation so that it's more modern" (namespace, DI, tests…). So it doesn't come with any addition of a "js tracker" feature (because it doesn't exist today). We could open that discussion, but to me it isn't related to namespace discussions. Getting the "Javascript tracking code" is a feature part (today) of the reporting API, not the tracking API. Is it perfect? Dunno, it could change. But after all, this is the PHP client to the tracking API, so unless we decide otherwise this isn't part of this project. And to be honest, I believe that if we add a way to get the javascript tracking code for a site in this client, then tracking client + reporting client should be merged (but I'm open to be convinced otherwise). My arguments for that are:
If you want to push this forward and want to start a discussion about merging both API clients, I'm encouraging you to open a discussion on piwik/piwik as it would be a discussion across repositories, so it would make sense IMO to discuss there. Also nobody else is participating in this one so it might be better to have more point of views on the topic. |
Discussion seems outdated. please create new issue if needed |
Can someone add a branch, either:
Obviously, the next step is to actually add a namespace. If someone is allowed to make an executive decision on that namespace (and class name), please do so and commit it. Otherwise, what's the process for making such a decision. As a starting point, a step in the right direction is:
Namespace: Piwik
ClassName: PhpTracker
I've also patched together the beginnings of a zf2 tracking module. I was learning ZF2 in parallel so it needs some work, but I would be willing to contribute it to Piwik (under a new name and more permissive license) if there was any interest in heading this direction.
The text was updated successfully, but these errors were encountered: