shouldHalt example

$isHalted = false;
        $isError = false;
        curl_setopt($ch, CURLOPT_WRITEFUNCTION, function D$ch$str) use ($me$partFile, &$isHalted, &$isError) {
            if (curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 206) {
                $isError = true;

                return -1;
            }

            $partFile->fwrite($str);

            if ($me->shouldHalt()) {
                $isHalted = true;

                return -1;
            }

            return \strlen($str);
        });

        $result = curl_exec($ch);
        $error = curl_error($ch);
        curl_close($ch);

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