قرینه از
https://github.com/matomo-org/matomo.git
synced 2025-08-22 06:57:53 +00:00

* Enable rule PSR12.Operators.OperatorSpacing.NoSpaceAfter * Enable rule PSR12.Operators.OperatorSpacing.NoSpaceBefore * Apply CS
34 خطوط
798 B
PHP
34 خطوط
798 B
PHP
<?php
|
|
|
|
use Piwik\Config\GeneralConfig;
|
|
use Piwik\Plugins\Marketplace\Api\Service;
|
|
use Piwik\Plugins\Marketplace\LicenseKey;
|
|
use Piwik\Container\Container;
|
|
|
|
return array(
|
|
'MarketplaceEndpoint' => function (Container $c) {
|
|
|
|
$domain = 'plugins.matomo.org';
|
|
|
|
if (GeneralConfig::getConfigValue('force_matomo_http_request') == 1) {
|
|
return 'http://' . $domain;
|
|
}
|
|
|
|
return 'https://' . $domain;
|
|
},
|
|
'Piwik\Plugins\Marketplace\Api\Service' => function (Container $c) {
|
|
/** @var Service $previous */
|
|
|
|
$domain = $c->get('MarketplaceEndpoint');
|
|
|
|
$service = new Service($domain);
|
|
|
|
$key = new LicenseKey();
|
|
$accessToken = $key->get();
|
|
|
|
$service->authenticate($accessToken);
|
|
|
|
return $service;
|
|
},
|
|
);
|