PHP Класс 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');
Автор: Phi1 'l0rdphi1' Stier ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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

Открытые методы

Метод Описание
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.

Описание методов

add_header() публичный метод

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

bind() публичный метод

public bind ( $ip = '' )

clear_headers() публичный метод

Clears any extra headers.
public clear_headers ( )

connect() публичный метод

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

fetch_body() публичный метод

Return the body of result (stuff after header).
public fetch_body ( ) : string
Результат string result body

fetch_header() публичный метод

Return the header of result (stuff before body).
public fetch_header ( $header = '' ) : array
Результат array result header

fetch_parsed_body() публичный метод

Return parsed body in array format.
public fetch_parsed_body ( ) : array
Результат array result parsed

fetch_result() публичный метод

Return the result of a query.
public fetch_result ( ) : string
Результат string result

get() публичный метод

The quick way to get a URL's content :)
public get ( $location, $asArray = FALSE ) : string
Результат string result body

getTransferSpeed() публичный метод

public getTransferSpeed ( )

get_status_code() публичный метод

200 = OK; 403 = FORBIDDEN; etc.
public get_status_code ( ) : integer
Результат integer status code

query() публичный метод

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

set_login() публичный метод

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

set_method() публичный метод

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

set_ssl_setting_message() публичный метод

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 )

Описание свойств

$bind_host публичное свойство

public $bind_host

$doFollowLocationHeader публичное свойство

public $doFollowLocationHeader

$error публичное свойство

public $error

$extra_headers публичное свойство

public $extra_headers

$lastTransferSpeed публичное свойство

public $lastTransferSpeed

$max_redirects публичное свойство

public $max_redirects

$method публичное свойство

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

$query_cache публичное свойство

public $query_cache

$redirectURL публичное свойство

public $redirectURL

$remote_host публичное свойство

public $remote_host

$remote_passwd публичное свойство

public $remote_passwd

$remote_port публичное свойство

public $remote_port

$remote_uname публичное свойство

public $remote_uname

$result публичное свойство

public $result

$result_body публичное свойство

public $result_body

$result_header публичное свойство

public $result_header

$result_status_code публичное свойство

public $result_status_code

$ssl_setting_message публичное свойство

public $ssl_setting_message

$version публичное свойство

public $version

$warn публичное свойство

public $warn