src/Net/CURL.php
public function exec( $breakOnError = FALSE, $parseHeaders = TRUE )
	{
		$url	= $this->getOption( CURLOPT_URL );
		if( empty( $url ) )
			throw new RuntimeException( 'No URL set.' );
		if( !preg_match( "@[a-z]+://[a-z0-9]+.+@i", $url ) )
			throw new InvalidArgumentException( 'URL "'.$url.'" has no valid protocol' );

		$result = curl_exec( $this->handle );
		$this->info = curl_getinfo( $this->handle );
		$this->info['errno']	= curl_errno( $this->handle );
		$this->info['error']	= curl_error( $this->handle );

		if( $breakOnError && $this->info['errno'] )
			throw new RuntimeException( $this->info['error'], $this->info['errno'] );
		if( $this->getOption( CURLOPT_HEADER ) && $parseHeaders )
		{
#			$result	= preg_replace( "@^HTTP/1\.1 100 Continue\r\n\r\n@", "", $result );				//  Hack: remove "100 Continue"
			$header	= mb_substr( $result, 0, $this->info['header_size'] );
			$result	= mb_substr( $result, $this->info['header_size'] );
			$this->parseHeaderSection( $header );															//  parse Header Block
		}
		return $result;
	}
public function exec( $breakOnError = FALSE, $parseHeaders = TRUE )
	{
		$url	= $this->getOption( CURLOPT_URL );
		if( empty( $url ) )
			throw new RuntimeException( 'No URL set.' );
		if( !preg_match( "@[a-z]+://[a-z0-9]+.+@i", $url ) )
			throw new InvalidArgumentException( 'URL "'.$url.'" has no valid protocol' );

		$result = curl_exec( $this->handle );
		$this->info = curl_getinfo( $this->handle );
		$this->info['errno']	= curl_errno( $this->handle );
		$this->info['error']	= curl_error( $this->handle );

		if( $breakOnError && $this->info['errno'] )
			throw new RuntimeException( $this->info['error'], $this->info['errno'] );
		if( $this->getOption( CURLOPT_HEADER ) && $parseHeaders )
		{
#			$result	= preg_replace( "@^HTTP/1\.1 100 Continue\r\n\r\n@", "", $result );				//  Hack: remove "100 Continue"
			$header	= mb_substr( $result, 0, $this->info['header_size'] );
			$result	= mb_substr( $result, $this->info['header_size'] );
			$this->parseHeaderSection( $header );															//  parse Header Block
		}
		return $result;
	}
public function exec ( $ breakOnError = FALSE , $ parseHeaders = TRUE ) { $ url = $ this -> getOption ( CURLOPT_URL ) ; if ( empty ( $ url ) ) throw new RuntimeException ( 'No URL set.' ) ; if ( ! preg_match ( "@[a-z]+://[a-z0-9]+.+@i" , $ url ) ) throw new InvalidArgumentException ( 'URL "' . $ url . '" has no valid protocol' ) ; $ result = curl_exec ( $ this -> handle ) ; $ this -> info = curl_getinfo ( $ this -> handle ) ; $ this -> info [ 'errno' ] = curl_errno ( $ this -> handle ) ; $ this -> info [ 'error' ] = curl_error ( $ this -> handle ) ; if ( $ breakOnError && $ this -> info [ 'errno' ] ) throw new RuntimeException ( $ this -> info [ 'error' ] , $ this -> info [ 'errno' ] ) ; if ( $ this -> getOption ( CURLOPT_HEADER ) && $ parseHeaders ) { #			$result	= preg_replace( "@^HTTP/1\.1 100 Continue\r\n\r\n@", "", $result );				//  Hack: remove "100 Continue" $ header = mb_substr ( $ result , 0 , $ this -> info [ 'header_size' ] ) ; $ result = mb_substr ( $ result , $ this -> info [ 'header_size' ] ) ; $ this -> parseHeaderSection ( $ header ) ; //  parse Header Block } return $ result ; }
Execute the cURL request and return the result.
@access		public
@param		bool		$breakOnError		Flag: throw an Exception if a Error has occured
@return		string
@link		http://www.php.net/curl_exec
@link		http://www.php.net/curl_getinfo
@link		http://www.php.net/curl_errno
@link		http://www.php.net/curl_error
Execute the cURL request and return the result .