public function fetchIntoFile ($url, $fp, $ip = null, $timeout = 5)
	{
		// set url to post to
		curl_setopt($this->ch, CURLOPT_URL, $url);

		//set method to get
		curl_setopt($this->ch, CURLOPT_HTTPGET, true);

		// store data into file rather than displaying it
		curl_setopt($this->ch, CURLOPT_FILE, $fp);

		//bind to specific ip address if it is sent trough arguments
		if ($ip)
		{
			curl_setopt($this->ch, CURLOPT_INTERFACE, $ip);
		}

		//set curl function timeout to $timeout
		curl_setopt($this->ch, CURLOPT_TIMEOUT, $timeout);

		//and finally send curl request
		curl_exec($this->ch);

		if ($this->hasError())
		{
			return false;
		}

		return true;
	}
public function fetchIntoFile ($url, $fp, $ip = null, $timeout = 5)
	{
		// set url to post to
		curl_setopt($this->ch, CURLOPT_URL, $url);

		//set method to get
		curl_setopt($this->ch, CURLOPT_HTTPGET, true);

		// store data into file rather than displaying it
		curl_setopt($this->ch, CURLOPT_FILE, $fp);

		//bind to specific ip address if it is sent trough arguments
		if ($ip)
		{
			curl_setopt($this->ch, CURLOPT_INTERFACE, $ip);
		}

		//set curl function timeout to $timeout
		curl_setopt($this->ch, CURLOPT_TIMEOUT, $timeout);

		//and finally send curl request
		curl_exec($this->ch);

		if ($this->hasError())
		{
			return false;
		}

		return true;
	}
public function fetchIntoFile ( $ url , $ fp , $ ip = null , $ timeout = 5 ) { // set url to post to curl_setopt ( $ this -> ch , CURLOPT_URL , $ url ) ; //set method to get curl_setopt ( $ this -> ch , CURLOPT_HTTPGET , true ) ; // store data into file rather than displaying it curl_setopt ( $ this -> ch , CURLOPT_FILE , $ fp ) ; //bind to specific ip address if it is sent trough arguments if ( $ ip ) { curl_setopt ( $ this -> ch , CURLOPT_INTERFACE , $ ip ) ; } //set curl function timeout to $timeout curl_setopt ( $ this -> ch , CURLOPT_TIMEOUT , $ timeout ) ; //and finally send curl request curl_exec ( $ this -> ch ) ; if ( $ this -> hasError ( ) ) { return false ; } return true ; }
Fetch data from target URL and store it directly into file

@param string   $url
@param resource $fp      stream resource(ie. fopen)
@param string   $ip      address to bind (default null)
@param int      $timeout in sec for complete curl operation (default 5)

@return boolean true on success false othervise
@access public
Fetch data from target URL and store it directly into file