Skip to content

Commit

Permalink
Merge pull request #57 from matomo-org/classavailability
Browse files Browse the repository at this point in the history
Ensure PiwikTracker and MatomoTracker are both available
  • Loading branch information
sgiehl committed Jan 14, 2020
2 parents 64248e1 + 0c73a80 commit 4129cdf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions MatomoTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -2050,3 +2050,12 @@ function Matomo_getUrlTrackGoal($idSite, $idGoal, $revenue = 0.0)

return $tracker->getUrlTrackGoal($idGoal, $revenue);
}

/**
* Ensure PiwikTracker class is available as well
*
* @deprecated
*/
if (!class_exists('\PiwikTracker')) {
include_once('./PiwikTracker.php');
}
4 changes: 3 additions & 1 deletion PiwikTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
* @package MatomoTracker
*/

include_once('./MatomoTracker.php');
if (!class_exists('\MatomoTracker')) {
include_once('./MatomoTracker.php');
}

/**
* Helper function to quickly generate the URL to track a page view.
Expand Down

0 comments on commit 4129cdf

Please sign in to comment.