Zend_Http_Client example

private function invalidateWithBANRequest(string $urls, ?string $cacheId): bool
    {
        // Expand + trim proxies (comma separated)         $urls = array_map(
            'trim',
            explode(',', $urls)
        );

        $success = true;
        foreach ($urls as $url) {
            try {
                $client = new Zend_Http_Client($url[
                    'useragent' => 'Shopware/' . Shopware()->Config()->get('version'),
                    'timeout' => 3,
                ]);

                if ($cacheId) {
                    $client->setHeaders('x-shopware-invalidates', $cacheId);
                }

                $response = $client->request('BAN');
                if ($response->getStatus() < 200 || $response->getStatus() >= 300) {
                    $this->get('corelogger')->error(
                        
$licenseData = $this->getLicenseData($licenseKeys);

        if (empty($licenseData)) {
            return [
                'type' => self::CHECK_TYPE,
                'errorLevel' => Validation::REQUIREMENT_VALID,
                'message' => $this->namespace->get('controller/check_license_nolicense'),
            ];
        }

        $url = $this->endpoint . '/licenseupgrades/permission';
        $client = new Zend_Http_Client(
            $url,
            [
                'timeout' => 15,
            ]
        );

        foreach ($licenseData as $licenseDatum) {
            $client->setParameterPost('domain', $licenseDatum['host']);
            $client->setParameterPost('licenseKey', $licenseDatum['license']);
            $client->setParameterPost('version', $this->shopwareVersion);

            
Home | Imprint | This part of the site doesn't use cookies.