Loading matomo_reporting_api.module +8 −1 Original line number Diff line number Diff line <?php use Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException; use GuzzleHttp\Exception\ConnectException; /** Loading @@ -16,7 +17,13 @@ use GuzzleHttp\Exception\ConnectException; */ function matomo_reporting_api_get_api_version() { /** @var \Matomo\ReportingApi\QueryResult $result */ try { $query = \Drupal::service('matomo.query_factory')->getQuery('API.getMatomoVersion'); } catch (MissingMatomoServerUrlException $e) { return FALSE; } try { $result = $query->execute(); if (!$result->hasError() && $result->parameterExists('value')) { Loading src/MatomoQueryFactoryInterface.php +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ interface MatomoQueryFactoryInterface { * @return \Matomo\ReportingApi\QueryInterface * The Matomo reporting API query object. * * @throws \Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException * Thrown when the Matomo server URL has not been configured. * * @see https://developer.matomo.org/api-reference/reporting-api#api-method-list */ public function getQuery($method); Loading @@ -26,6 +29,9 @@ interface MatomoQueryFactoryInterface { * * @return \Matomo\ReportingApi\QueryFactoryInterface * The query factory. * * @throws \Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException * Thrown when the Matomo server URL has not been configured. */ public function getQueryFactory(); Loading Loading
matomo_reporting_api.module +8 −1 Original line number Diff line number Diff line <?php use Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException; use GuzzleHttp\Exception\ConnectException; /** Loading @@ -16,7 +17,13 @@ use GuzzleHttp\Exception\ConnectException; */ function matomo_reporting_api_get_api_version() { /** @var \Matomo\ReportingApi\QueryResult $result */ try { $query = \Drupal::service('matomo.query_factory')->getQuery('API.getMatomoVersion'); } catch (MissingMatomoServerUrlException $e) { return FALSE; } try { $result = $query->execute(); if (!$result->hasError() && $result->parameterExists('value')) { Loading
src/MatomoQueryFactoryInterface.php +6 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,9 @@ interface MatomoQueryFactoryInterface { * @return \Matomo\ReportingApi\QueryInterface * The Matomo reporting API query object. * * @throws \Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException * Thrown when the Matomo server URL has not been configured. * * @see https://developer.matomo.org/api-reference/reporting-api#api-method-list */ public function getQuery($method); Loading @@ -26,6 +29,9 @@ interface MatomoQueryFactoryInterface { * * @return \Matomo\ReportingApi\QueryFactoryInterface * The query factory. * * @throws \Drupal\matomo_reporting_api\Exception\MissingMatomoServerUrlException * Thrown when the Matomo server URL has not been configured. */ public function getQueryFactory(); Loading