matomo-org / matomo-php-tracker

PHP Client for Matomo Analytics Tracking API
BSD 3-Clause "New" or "Revised" License
212 stars 83 forks source link

PSR-7 support #34

Open WyriHaximus opened 6 years ago

WyriHaximus commented 6 years ago

Are there any plans for PSR-7 support? It would be great if we could set up tracking and then get a PSR-7 request from the tracker to send it out using our own HTTP client. Also creating a new tracker from a PSR-7 server request would be appreciated. If you're open for this I gladly make both PR's

oscarotero commented 6 years ago

I'm working in a PSR-15 middleware for this here: https://github.com/oscarotero/matomo-tracker and ported the library to PHP7, supporting PSR-1, PSR-2, PSR-4 and PSR-7 (currently in a very early stage). I'd prefer to use this package as a dependency instead rewrite it, so if there's a plan to update it, I'd be happy to help.

tsteur commented 6 years ago

That sounds good, I presume we could potentially ship both the old (for BC) and new version

WyriHaximus commented 6 years ago

@oscarotero awesome 👍! My intentions where never to propose a full rewrite but rather a polish up to the latest PSR's without doing a BC break.

Maybe it's an idea to keep the piwik one as is and do a rewrite/polish up name matono?

oscarotero commented 6 years ago

Great. I have a fork with inital changes here: https://github.com/oscarotero/matomo-php-tracker/tree/psr-7

There's are many changes that need to be done and adding some tests would be nice.

I think a new matomo/php-tracker package is the best choice. Let me know how do you like to continue.

tsteur commented 6 years ago

I think a new matomo/php-tracker package is the best choice.

Why is it the best choice? I would have thought keeping it in here for best user experience, easy upgrade, easy manage of existing future issues etc in one repository maybe.

oscarotero commented 6 years ago

Because the current package is registered as piwik/piwik-php-tracker in packagist, so it's a good chance to change the package name to "matomo". In any case, I think we can use the same repo for the two versions creating two branches (for example 1.x and 2.x)

burzum commented 6 years ago

Nice work @oscarotero I was about to do what you've already done. 😄 Thumbs up for your implementation to become the new official implementation.

NicoHood commented 3 years ago

Any updates on this?