diff options
Diffstat (limited to 'plugins/Marketplace/config/config.php')
-rw-r--r-- | plugins/Marketplace/config/config.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/plugins/Marketplace/config/config.php b/plugins/Marketplace/config/config.php new file mode 100644 index 0000000000..ffab9b07b4 --- /dev/null +++ b/plugins/Marketplace/config/config.php @@ -0,0 +1,32 @@ +<?php + +use Interop\Container\ContainerInterface; +use Piwik\Plugins\Marketplace\Api\Service; +use Piwik\Plugins\Marketplace\LicenseKey; + +return array( + 'MarketplaceEndpoint' => function (ContainerInterface $c) { + $domain = 'http://plugins.piwik.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; + } +);
\ No newline at end of file |