set() public method

public set ( string | null | false $licenseKey )
$licenseKey string | null | false `null` or `false` will delete an existing a license key
コード例 #1
0
ファイル: API.php プロジェクト: piwik/piwik
 private function setLicenseKey($licenseKey)
 {
     $key = new LicenseKey();
     $key->set($licenseKey);
     $this->marketplaceClient->clearAllCacheEntries();
     $this->expired->clearCache();
 }
コード例 #2
0
ファイル: test.php プロジェクト: piwik/piwik
return array('MarketplaceEndpoint' => function (ContainerInterface $c) {
    // if you wonder why this here is configured here again, and the same as in `config.php`,
    // it is because someone might have overwritten MarketplaceEndpoit in local config.php and we want
    // to make sure system tests of marketplace are ran against plugins.piwik.org
    $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\\Consumer' => function (ContainerInterface $c) {
    $consumerTest = $c->get('test.vars.consumer');
    $licenseKey = new LicenseKey();
    if ($consumerTest == 'validLicense') {
        $consumer = MockConsumer::buildValidLicense();
        $licenseKey->set('123456789');
    } elseif ($consumerTest == 'exceededLicense') {
        $consumer = MockConsumer::buildExceededLicense();
        $licenseKey->set('1234567891');
    } elseif ($consumerTest == 'expiredLicense') {
        $consumer = MockConsumer::buildExpiredLicense();
        $licenseKey->set('1234567892');
    } else {
        $consumer = MockConsumer::buildNoLicense();
        $licenseKey->set(null);
    }
    return $consumer;
}, 'Piwik\\Plugins\\Marketplace\\Plugins' => DI\decorate(function ($previous, ContainerInterface $c) {
    /** @var \Piwik\Plugins\Marketplace\Plugins $previous */
    $previous->setPluginsHavingUpdateCache(null);
    $pluginNames = $c->get('test.vars.mockMarketplaceAssumePluginNamesActivated');