protected function downloadTempFile($url)
    {
        $temp = $this->file->getTempFile();

        $fh = fopen($temp, "w");

        if (!is_resource($fh)) {
            throw new UnexpectedValueException($this->translation->text('File handle is not a valid resource'));
        }

        $response = $this->http->request($url);
        fwrite($fh, $response['data']);
        fclose($fh);

        return $temp;
    }
protected function downloadTempFile($url)
    {
        $temp = $this->file->getTempFile();

        $fh = fopen($temp, "w");

        if (!is_resource($fh)) {
            throw new UnexpectedValueException($this->translation->text('File handle is not a valid resource'));
        }

        $response = $this->http->request($url);
        fwrite($fh, $response['data']);
        fclose($fh);

        return $temp;
    }
protected function downloadTempFile ( $ url ) { $ temp = $ this -> file -> getTempFile ( ) ; $ fh = fopen ( $ temp , "w" ) ; if ( ! is_resource ( $ fh ) ) { throw new UnexpectedValueException ( $ this -> translation -> text ( 'File handle is not a valid resource' ) ) ; } $ response = $ this -> http -> request ( $ url ) ; fwrite ( $ fh , $ response [ 'data' ] ) ; fclose ( $ fh ) ; return $ temp ; }
Writes a temporary file from a remote file
@param string $url
@return string
@throws UnexpectedValueException
Writes a temporary file from a remote file