blob: ac6a1bb0dfbc448e92c08880ad69422db78b02ac (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<?php
use Psr\Container\ContainerInterface;
use Piwik\Plugins\Marketplace\Api\Service;
use Piwik\Plugins\Marketplace\LicenseKey;
return array(
'MarketplaceEndpoint' => function (ContainerInterface $c) {
$domain = 'http://plugins.matomo.org';
$updater = $c->get('Piwik\Plugins\CoreUpdater\Updater');
if ($updater->isUpdatingOverHttps()) {
$domain = str_replace('http://', 'https://', $domain);
}
return $domain;
},
'Piwik\Plugins\Marketplace\Api\Service' => function (ContainerInterface $c) {
/** @var \Piwik\Plugins\Marketplace\Api\Service $previous */
$domain = $c->get('MarketplaceEndpoint');
$service = new Service($domain);
$key = new LicenseKey();
$accessToken = $key->get();
$service->authenticate($accessToken);
return $service;
}
);
|