AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Namespaces

  • Alo
    • Cache
    • CLI
    • Controller
    • Db
      • Query
    • Exception
    • FileSystem
    • Session
    • Traversables
    • Validators
    • Windows
  • Controller
  • None
  • PHP

Classes

  • Cookie
  • Cron
  • Curl
  • Email
  • Format
  • Handler
  • Locale
  • Profiler
  • Security
  • SFTP

Class Curl

Object-oriented Curl wrapper

Namespace:Alo
Author:Art <a.molcanovas@gmail.com>
Located atsys/class/alo/curl.php

Methods summary

public
#__construct(string$url=null)

Instantiates the library

Instantiates the library

Parameters

$url
string
$url Optionally, the URL for curl_init()

Throws

Alo\Exception\ExtensionException
When the curl extention is not loaded

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#setURL(string$url)

Sets the connection URL

Sets the connection URL

Parameters

$url
string
$url The URL

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>
public staticAlo\Curl
#cURL(string$url=null)

Instantiates the library

Instantiates the library

Parameters

$url
string
$url Optionally, the URL for curl_init()

Returns

Alo\Curl

Throws

Alo\Exception\ExtensionException
When the curl extention is not loaded

Author

Art <a.molcanovas@gmail.com>
public staticAlo\Curl
#init(string$url=null)

A static wrapper function for __construct()

A static wrapper function for __construct()

Parameters

$url
string
$url Optionally, the URL for curl_init()

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>
public boolean
#setProgressFunction(callable$callable)

Sets CURLOPT_NOPROGRESS to FALSE and supplies the progress function

Sets CURLOPT_NOPROGRESS to FALSE and supplies the progress function

Parameters

$callable
callable
$callable The function

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#notimeout(boolean$enabled=true)

Set whether Curl should time out

Set whether Curl should time out

Parameters

$enabled
boolean
$enabled The switch

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#setoptArray(array$a)

Sets an array of options

Sets an array of options

Parameters

$a
array
$a An array specifying which options to set and their values. The keys should be valid curl_setopt() constants or their integer equivalents.

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-setopt-array.php
publicAlo\Curl
#laxSSLMode(boolean$enabled=true)

Toggles lax SSL verification mode which doesn't check certificates

Toggles lax SSL verification mode which doesn't check certificates

Parameters

$enabled
boolean
$enabled Whether the mode is enabled or disabled

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>
public string
#__toString( )

Returns a string representation of the object data

Returns a string representation of the object data

Returns

string

Author

Art <a.molcanovas@gmail.com>
public string
#escape(string$str)

URL encodes the given string

URL encodes the given string

Parameters

$str
string
$str The string

Returns

string
The escaped string

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-escape.php
public integer
#pause(integer$bitmask)

Pause and unpause a connection

Pause and unpause a connection

Parameters

$bitmask
integer
$bitmask One of CURLPAUSE_* constants.

Returns

integer
An error code (CURLE_OK for no error).

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-pause.php
public array
#version(integer$age= CURLVERSION_NOW)

Gets Curl version information

Gets Curl version information

Parameters

$age
integer
$age

Returns

array

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-version.php
public boolean|integer
#wasSuccessful( )

Checks whether the last transfer was successful

Checks whether the last transfer was successful

Returns

boolean|integer
If successful - true, if not & Curl error code exists - Curl error code, false otherwise

Author

Art <a.molcanovas@gmail.com>
public mixed
#getinfo(integer$opt=0)

Get information regarding a specific transfer

Get information regarding a specific transfer

Parameters

$opt
integer
$opt One of the Curl constants

Returns

mixed

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-getinfo.php
publicAlo\Curl
#reset( )

Reset all options of a libcurl session handle

Reset all options of a libcurl session handle

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-reset.php
public string
#unescape(string$str)

Decodes the given URL encoded string

Decodes the given URL encoded string

Parameters

$str
string
$str

Returns

string
The decoded string

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-unescape.php
public
#__destruct( )

Auto-cleanup

Auto-cleanup

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#close( )

Closes a Curl connection

Closes a Curl connection

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-close.php
public mixed
#get(string$url=null)

Gets the results of a Curl exec. If $url is set, will exec on that URL

Gets the results of a Curl exec. If $url is set, will exec on that URL

Parameters

$url
string
$url Optional URL override

Returns

mixed
The results of exec()

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#exec( )

Executes the Curl connection parameters

Executes the Curl connection parameters

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-exec.php
public string
#error( )

Returns the error message of the last exec()

Returns the error message of the last exec()

Returns

string

Author

Art <a.molcanovas@gmail.com>

See

Alo\Curl::exec()

Link

http://php.net/manual/en/function.curl-error.php
public integer
#errno( )

Returns the error number of the last exec() or 0 if no error occurred

Returns the error number of the last exec() or 0 if no error occurred

Returns

integer

Author

Art <a.molcanovas@gmail.com>

See

Alo\Curl::exec()

Link

http://php.net/manual/en/function.curl-errno.php
public
#__set(string$name,mixed$value)

Wrapper for setopt()

Wrapper for setopt()

Parameters

$name
string
$name Param name
$value
mixed
$value Param value

Author

Art <a.molcanovas@gmail.com>
publicAlo\Curl
#setopt(integer$name,mixed$value)

Sets an option

Sets an option

Parameters

$name
integer
$name The option - see Curl constants
$value
mixed
$value The option value

Returns

Alo\Curl

Author

Art <a.molcanovas@gmail.com>

Link

http://php.net/manual/en/function.curl-setopt.php

Magic methods summary

Properties summary

public staticAlo\Curl$this
#

Static reference to the last instance of the class

Static reference to the last instance of the class

protected resource$ch
#

The Curl resource

The Curl resource

protected mixed$exec
#

Result of exec()

Result of exec()

See

Alo\Curl::exec()
protected integer$errno
#

Error number of exec()

Error number of exec()

See

Alo\Curl::exec()
protected string$error
#

Error message of exec()

Error message of exec()

See

Alo\Curl::exec()
protected boolean$isOpen
#

Whether the connection is open

Whether the connection is open

AloFramework documentation API documentation generated byApiGen 2.8.0