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

Class: Net_Curl

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

Class Overview




Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 27]


[ Top ]


Class Variables

$caInfo =  ''

[line 297]

$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 308]

$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 206]

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

Type:   array


[ Top ]

$fields =

[line 231]

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

Type:   array


[ Top ]

$file =

[line 178]

The file to upload
  • Access: public

Type:   string


[ Top ]

$fileSize =

[line 187]

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

Type:   integer


[ Top ]

$file_size =  false

[line 197]

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

Type:   integer


[ Top ]

$followLocation =  true

[line 126]

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

Type:   boolean


[ Top ]

$follow_location =  false

[line 135]

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

Type:   boolean


[ Top ]

$header =  false

[line 93]

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

Type:   boolean


[ Top ]

$httpHeaders =  null

[line 214]

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

Type:   array


[ Top ]

$http_headers =  false

[line 223]

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

Type:   array


[ Top ]

$mute =  false

[line 118]

Whether or not to suppress error messages
  • Access: public

Type:   boolean


[ Top ]

$password =  ''

[line 52]

The Password for standard HTTP Authentication
  • Access: public

Type:   string


[ Top ]

$progress =  false

[line 110]

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

Type:   boolean


[ Top ]

$proxy =

[line 239]

The proxy server to go through
  • Access: public

Type:   string


[ Top ]

$proxyPassword =

[line 255]

The password for the Proxy server
  • Access: public

Type:   string


[ Top ]

$proxyUser =

[line 247]

The username for the Proxy server
  • Access: public

Type:   string


[ Top ]

$returnTransfer =  true

[line 152]

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

Type:   boolean


[ Top ]

$return_transfer =  false

[line 162]

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

Type:   boolean


[ Top ]

$sslCert =

[line 68]

The filename of the SSL certificate
  • Access: public

Type:   string


[ Top ]

$sslCertPasswd =

[line 77]

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

Type:   string


[ Top ]

$sslVersion =

[line 60]

The SSL version for the transfer
  • Access: public

Type:   integer


[ Top ]

$timeout =  0

[line 143]

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

Type:   int


[ Top ]

$type =

[line 170]

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

Type:   string


[ Top ]

$url =

[line 36]

The URL for cURL to work with
  • Access: public

Type:   string


[ Top ]

$userAgent =

[line 85]

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

Type:   string


[ Top ]

$username =  ''

[line 44]

The Username for standard HTTP Authentication
  • Access: public

Type:   string


[ Top ]

$verbose =  false

[line 102]

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

Type:   boolean


[ Top ]

$verifyHost =  2

[line 283]

$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 270]

$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 362]

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

Net_Curl

PHP 4.x constructor.


Parameters:

   $url   — 
   $userAgent   — 

[ Top ]

__construct (Constructor)   [line 342]

Net_Curl __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 792]

void __destruct( )

__destruct

PHP 5.x destructor. Runs Net_Curl::close() to make sure we close our cURL connection.


[ Top ]

close   [line 728]

void close( )

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

[ Top ]

create   [line 671]

mixed create( )

create

Create a cURL resource. If curl_init() doesn't exist or we could not create a resource it will error out.

  • Return: PEAR_Error on failure, true on success
  • Author: Joe Stump <joe@joestump.net>

[ Top ]

execute   [line 395]

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 652]

mixed getInfo( )

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 632]

boolean setOption( int $option, mixed $value)

setOption

Set a 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   — 

[ Top ]

verboseAll   [line 696]

void verboseAll( )

Set a verbose output

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


[ Top ]

verbose_all   [line 712]

void verbose_all( )

Set a verbose output

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:16:59 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.