Skip to content

PSR-7 support #34

Description

@WyriHaximus

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

Activity

  1. oscarotero commented on Sep 5, 2018

    @oscarotero

    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.

  2. tsteur commented on Sep 5, 2018

    @tsteur
    Member

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

  3. WyriHaximus commented on Sep 5, 2018

    @WyriHaximus
    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?

  4. oscarotero commented on Sep 5, 2018

    @oscarotero

    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.

  5. tsteur commented on Sep 5, 2018

    @tsteur
    Member

    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.

  6. oscarotero commented on Sep 5, 2018

    @oscarotero

    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)

  7. burzum commented on Nov 15, 2018

    @burzum

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

  8. NicoHood commented on Dec 22, 2020

    @NicoHood

    Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions