Skip to content
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

PSR-7 support #34

Open
WyriHaximus opened this issue Aug 21, 2018 · 8 comments
Open

PSR-7 support #34

WyriHaximus opened this issue Aug 21, 2018 · 8 comments

Comments

@WyriHaximus
Copy link

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
Copy link

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
Copy link
Member

tsteur commented Sep 5, 2018

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

@WyriHaximus
Copy link
Author

@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
Copy link

oscarotero commented Sep 5, 2018

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

  • Compliance with PSR-1/2 code style
  • Removed the superglobals ($_GET, $_COOKIES, etc) and use a PSR-7 server request
  • Autoload using PSR-4
  • Minimum requirement is PHP ^7.0 in order to use the new types (string, int), return types, and other cool features.

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
Copy link
Member

tsteur commented Sep 5, 2018

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
Copy link

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
Copy link

burzum commented Nov 15, 2018

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
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants