PHP Class DirectAdmin\LetsEncrypt\Lib\HTTPSocket

Originally designed for use with DirectAdmin's API, this class will fill any HTTP socket need. Very, very basic usage: $Socket = new HTTPSocket; echo $Socket->get('http://user:[email protected]/somedir/some.file?query=string&this=that');
Author: Phi1 'l0rdphi1' Stier ([email protected])
Show file Open project: Petertjuh360/da-letsencrypt Class Usage Examples

Public Properties

Property Type Description
$bind_host
$doFollowLocationHeader
$error
$extra_headers
$lastTransferSpeed
$max_redirects
$method * all vars are private except $error, $query_cache, and $doFollowLocationHeader
$query_cache
$redirectURL
$remote_host
$remote_passwd
$remote_port
$remote_uname
$result
$result_body
$result_header
$result_status_code
$ssl_setting_message
$version
$warn

Public Methods

Method Description
add_header ( $key, $value ) Adds a header, sent with the next query.
bind ( $ip = '' )
clear_headers ( ) Clears any extra headers.
connect ( $host, $port = '' ) Create server "connection".
fetch_body ( ) : string Return the body of result (stuff after header).
fetch_header ( $header = '' ) : array Return the header of result (stuff before body).
fetch_parsed_body ( ) : array Return parsed body in array format.
fetch_result ( ) : string Return the result of a query.
get ( $location, $asArray = FALSE ) : string The quick way to get a URL's content :)
getTransferSpeed ( )
get_status_code ( ) : integer Returns the last status code.
query ( $request, $content = '', $doSpeedCheck ) Query the server
set_login ( $uname = '', $passwd = '' ) Specify a username and password.
set_method ( $method = 'GET' ) Change the method being used to communicate.
set_ssl_setting_message ( $str ) Set a specifc message on how to change the SSL setting, in the event that it's not set correctly.

Method Details

add_header() public method

Adds a header, sent with the next query.
public add_header ( $key, $value )

bind() public method

public bind ( $ip = '' )

clear_headers() public method

Clears any extra headers.
public clear_headers ( )

connect() public method

Create server "connection".
public connect ( $host, $port = '' )

fetch_body() public method

Return the body of result (stuff after header).
public fetch_body ( ) : string
return string result body

fetch_header() public method

Return the header of result (stuff before body).
public fetch_header ( $header = '' ) : array
return array result header

fetch_parsed_body() public method

Return parsed body in array format.
public fetch_parsed_body ( ) : array
return array result parsed

fetch_result() public method

Return the result of a query.
public fetch_result ( ) : string
return string result

get() public method

The quick way to get a URL's content :)
public get ( $location, $asArray = FALSE ) : string
return string result body

getTransferSpeed() public method

public getTransferSpeed ( )

get_status_code() public method

200 = OK; 403 = FORBIDDEN; etc.
public get_status_code ( ) : integer
return integer status code

query() public method

Query the server
public query ( $request, $content = '', $doSpeedCheck )

set_login() public method

Specify a username and password.
public set_login ( $uname = '', $passwd = '' )

set_method() public method

Change the method being used to communicate.
public set_method ( $method = 'GET' )

set_ssl_setting_message() public method

Set a specifc message on how to change the SSL setting, in the event that it's not set correctly.
public set_ssl_setting_message ( $str )

Property Details

$bind_host public property

public $bind_host

$doFollowLocationHeader public property

public $doFollowLocationHeader

$error public property

public $error

$extra_headers public property

public $extra_headers

$lastTransferSpeed public property

public $lastTransferSpeed

$max_redirects public property

public $max_redirects

$method public property

* all vars are private except $error, $query_cache, and $doFollowLocationHeader
public $method

$query_cache public property

public $query_cache

$redirectURL public property

public $redirectURL

$remote_host public property

public $remote_host

$remote_passwd public property

public $remote_passwd

$remote_port public property

public $remote_port

$remote_uname public property

public $remote_uname

$result public property

public $result

$result_body public property

public $result_body

$result_header public property

public $result_header

$result_status_code public property

public $result_status_code

$ssl_setting_message public property

public $ssl_setting_message

$version public property

public $version

$warn public property

public $warn