- Symphony 2.7.1
-
› assets
14 -
› boot
15 -
› core
24 -
› cryptography
4 -
› data-sources
6 -
› email-gateways
3 -
› events
3 -
› global
61 -
› interface
9 -
› toolkit
60 - Delegates101
- Deprecated28
Versions
- 2.7.9
- 2.7.8
- 2.7.7
- 2.7.6
- 2.7.5
- 2.7.3
- 2.7.2
- 2.7.10
- 2.7.1
- 2.7.0
- 2.6.9
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.11
- 2.6.10
- 2.6.1
- 2.6.0
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2
Options
public class Gateway
class.gateway.php #19The Gateway class provides a standard way to interact with other pages. By default it is essentially a wrapper for CURL, but if that is not available it falls back to use sockets.
Constants
static string FORCE_SOCKET = 'socket'
Constant used to explicitly bypass CURL and use Sockets to complete the request.
Methods
string|boolean exec(
$force_connection_method)
Executes the request using Curl unless it is not available
or this function has explicitly been told not by providing
the Gateway::FORCE_SOCKET
constant as a parameter. The function
will apply all the options set using curl_setopt
before
executing the request. Information about the transfer is
available using the getInfoLast()
function. Should Curl not be
available, this function will fallback to using Sockets with fsockopen
Parameters
Returns
The result of the transfer as a string. If any errors occur during a socket request, false will be returned.
See Also
void flush()
Resets $this->_postfields
variable to an empty string
array getInfoLast()
Returns some information about the last transfer, this
the same output array as expected when calling the
curl_getinfo()
function. If Sockets were used to complete
the request instead of CURL, the resulting array will be
the HTTP Code, Content Type, URL and Total Time of the resulting
request
See Also
void init(
$url)
Mimics curl_init in that a URL can be provided
Parameters
static boolean isCurlAvailable()
Checks to the see if CURL is available, if it isn't, false will be returned, and sockets will be used
void setopt(
$opt, $value)
A basic wrapper that simulates the curlsetopt function. Any
options that are not recognised by Symphony will fallback to
being added to the $custom_opt
array. Any options in $custom_opt
will be applied on executed using curlsetopt. Custom options are not
available for Socket requests. The benefit of using this function is for
convienience as it performs some basic preprocessing for some options
such as 'URL', which will take a full formatted URL string and set any
authentication or SSL curl options automatically