Net_Curl
[ class tree: Net_Curl ] [ index: Net_Curl ] [ all elements ]

Class: Net_Curl

Source Location: /Net_Curl-1.2.5/Net/Curl.php

Class Overview


Object-oriented implementation of the Curl extension


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 65]
Object-oriented implementation of the Curl extension


[ Top ]


Class Variables

$caInfo =  ''

[line 335]

$caInfo

Set value for CURLOPT_CAINFO. The name of a file holding one or more certificates to verify the peer with. This only makes sense when used in combination with CURLOPT_SSL_VERIFYPEER. curl-ca-bundle.crt is avaible on the Curl website http://curl.haxx.se/ for download inside the packages.

  • Access: public

Type:   string


[ Top ]

$caPath =

[line 346]

$caPath

Set value for CURLOPT_CAPATH. A directory that holds multiple CA certificates. Use this option alongside CURLOPT_SSL_VERIFYPEER.

  • Access: public

Type:   string


[ Top ]

$cookies = array()

[line 244]

The cookies to send to the remote site
  • Access: public

Type:   array


[ Top ]

$fields =

[line 269]

The fields to send in a 'POST' request
  • Access: public

Type:   array


[ Top ]

$file =

[line 216]

The file to upload (PUT, or FTP methods)
  • Access: public

Type:   string


[ Top ]

$fileSize =

[line 225]

The file size of the file pointed to by the $file property
  • Access: public

Type:   integer


[ Top ]

$file_size =  false

[line 235]

The file size of the file pointed to by the $file property
  • Deprecated:
  • Access: public

Type:   integer


[ Top ]

$followLocation =  true

[line 164]

Whether or not to follow HTTP Location headers.
  • Access: public

Type:   boolean


[ Top ]

$follow_location =  false

[line 173]

Whether or not to follow HTTP Location headers.
  • Deprecated:
  • Access: public

Type:   boolean


[ Top ]

$header =  false

[line 131]

Whether or not to include the header in the results of the CURL transfer

Type:   boolean


[ Top ]

$httpHeaders =  null

[line 252]

Additional HTTP headers to send to the remote site
  • Access: public

Type:   array


[ Top ]

$http_headers =  false

[line 261]

Additional HTTP headers to send to the remote site
  • Deprecated:
  • Access: public

Type:   array


[ Top ]

$mute =  false

[line 156]

Whether or not to suppress error messages
  • Access: public

Type:   boolean


[ Top ]

$password =  ''

[line 90]

The Password for standard HTTP Authentication
  • Access: public

Type:   string


[ Top ]

$progress =  false

[line 148]

Whether or not to display a progress meter for the current transfer
  • Access: public

Type:   boolean


[ Top ]

$proxy =

[line 277]

The proxy server to go through
  • Access: public

Type:   string


[ Top ]

$proxyPassword =

[line 293]

The password for the Proxy server
  • Access: public

Type:   string


[ Top ]

$proxyUser =

[line 285]

The username for the Proxy server
  • Access: public

Type:   string


[ Top ]

$returnTransfer =  true

[line 190]

Whether or not to return the results of the current transfer
  • Access: public

Type:   boolean


[ Top ]

$return_transfer =  false

[line 200]

Whether or not to return the results of the current transfer
  • Deprecated:
  • Access: public

Type:   boolean


[ Top ]

$sslCert =

[line 106]

The filename of the SSL certificate
  • Access: public

Type:   string


[ Top ]

$sslCertPasswd =

[line 115]

The password corresponding to the certificate in the $sslCert property
  • Access: public

Type:   string


[ Top ]

$sslVersion =

[line 98]

The SSL version for the transfer
  • Access: public

Type:   integer


[ Top ]

$timeout =  0

[line 181]

Time allowed for current transfer, in seconds. 0 means no limit
  • Access: public

Type:   int


[ Top ]

$type =

[line 208]

The type of transfer to perform (ie. 'POST', 'GET', 'PUT', etc)
  • Access: public

Type:   string


[ Top ]

$url =

[line 74]

The URL for cURL to work with
  • Access: public

Type:   string


[ Top ]

$userAgent =

[line 123]

User Agent string when making an HTTP request
  • Access: public

Type:   string


[ Top ]

$username =  ''

[line 82]

The Username for standard HTTP Authentication
  • Access: public

Type:   string


[ Top ]

$verbose =  false

[line 140]

Whether or not to output debug information while executing a curl transfer
  • Access: public

Type:   boolean


[ Top ]

$verifyHost =  2

[line 321]

$verifyHost

  1. : to stop CURL from verifying the host's certificate.
  2. : to check the existence of a common name in the SSL peer certificate.
  3. : to check the existence of a common name and also verify that it matches the hostname provided.

  • Access: public

Type:   bool


[ Top ]

$verifyPeer =  true

[line 308]

$verifyPeer

FALSE to stop CURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the CURLOPT_CAINFO option or a certificate directory can be specified with the CURLOPT_CAPATH option. CURLOPT_SSL_VERIFYHOST may also need to be TRUE or FALSE if CURLOPT_SSL_VERIFYPEER is disabled (it defaults to 2).

  • Access: public

Type:   boolean


[ Top ]



Method Detail

Net_Curl (Constructor)   [line 411]

void Net_Curl( [string $url = ''], [string $userAgent = ''])

Net_Curl

PHP 4.x constructor.

  • Access: public

Parameters:

string   $url   —  The URL to fetch (can be set using the $url property as well)
string   $userAgent   —  The userAgent string (can be set using the $userAgent property as well)

[ Top ]

__construct (Constructor)   [line 385]

void __construct( [string $url = ''], [string $userAgent = ''])

The Net_Curl PHP 5.x constructor, called when a new Net_Curl object is initialized (also called via 4.x constructor)

Parameters:

string   $url   —  The URL to fetch (can be set using the $url property as well)
string   $userAgent   —  The userAgent string (can be set using the $userAgent property as well)

[ Top ]

__destruct (Destructor)   [line 869]

void __destruct( )

PHP 5.x destructor.

Runs Net_Curl::close() to make sure we close our cURL connection.


[ Top ]

close   [line 804]

void close( )

Closes the curl transfer and finishes the object (kinda ;)

[ Top ]

create   [line 741]

boolean create( )

Creates a cURL resource. If curl_init() doesn't exist or we could not create a resource it will error out.
  • Return: TRUE on success, PEAR_Error on failure
  • Author: Joe Stump <joe@joestump.net>

[ Top ]

execute   [line 445]

PEAR_Error execute( )

Executes a prepared CURL transfer

Run this function to execute your cURL request. If all goes well you should get a string (the output from the remote host regarding your request) or true (if you choose to output directly to the browser). If something fails then PEAR_Error is returned.

  1.  <?php
  2.      require_once 'Net/Curl.php';
  3.  
  4.      $curl = new Net_Curl('http://www.example.com');
  5.      $curl->fields = array('foo' => '1''bar' => 'apple');
  6.      $result $curl->execute();
  7.      if (!PEAR::isError($result)) {
  8.          echo $result;
  9.      }
  10.  ?>


[ Top ]

getInfo   [line 723]

mixed getInfo( )

Returns the info from the cURL session. PEAR_Error if you try and run this before you execute the session.
  • Return: PEAR_Error if there is no resource, info on success
  • Author: Joe Stump <joe@joestump.net>
  • Access: public

[ Top ]

setOption   [line 704]

boolean setOption( int $option, mixed $value)

Sets an option for your cURL session. Please note that the cURL handler is NOT created before execute(). This is for error checking purposes.

You should use setOption() in the following manner:

  1.  <?php
  2.  
  3.  require_once 'Net/Curl.php';
  4.  $curl = new Net_Curl('http://www.example.com');
  5.  $check $curl->create();
  6.  if (!PEAR::isError($check)) {
  7.      $curl->setOption(CURLOPT_FOO'bar');
  8.      $result $curl->execute();
  9.      if (!PEAR::isError($result)) {
  10.          echo $result;
  11.      }
  12.  }
  13.  
  14.  ?>


Parameters:

int   $option   —  cURL constant (ie. CURLOPT_URL)
mixed   $value   —  The option's value

[ Top ]

verboseAll   [line 770]

void verboseAll( )

Sets verbose output

Turns on super debugging mode by not suppressing errors, turning on verbose mode, showing headers and displaying progress.


[ Top ]

verbose_all   [line 788]

void verbose_all( )

Sets verbose output

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.