\org_openpsa_httplib

HTTP content fetching library

Note, that the request data, for ease of use, already contains the L10n Databases of the Component and MidCOM itself located in this class. They are stored as 'l10n' and 'l10n_midcom'. Also available as 'config' is the current component configuration.

Summary

Methods
Properties
Constants
__construct()
__get()
__isset()
set_active_leaf()
add_stylesheet()
get_workflow()
set_param()
get()
post()
$_component
$error
$basicauth
$_i18n
$_l10n
$_l10n_midcom
$_config
No constants found
No protected methods found
No protected properties found
N/A
get_client()
send()
$_services
$params
N/A

Properties

$_component

$_component : string

The name of the component, e.g. net.nehmer.static. Should be used whenever the component's name is required instead of hardcoding it.

Type

string

$error

$error : 

Type

$basicauth

$basicauth : 

Type

$_i18n

$_i18n : \midcom_services_i18n

A handle to the i18n service.

Type

\midcom_services_i18n

$_l10n

$_l10n : \midcom_services_i18n_l10n

The components' L10n string database.

Type

\midcom_services_i18n_l10n

$_l10n_midcom

$_l10n_midcom : \midcom_services_i18n_l10n

The global MidCOM string database.

Type

\midcom_services_i18n_l10n

$_config

$_config : \midcom_helper_configuration

The current configuration.

Type

\midcom_helper_configuration

$_services

$_services : array

Array that holds the already instantiated services

Type

array

$params

$params : 

Type

Methods

__construct()

__construct() 

Initialize all member variables, remember to set $_component before calling this constructor from your derived classes.

__get()

__get(  $field) 

Parameters

$field

__isset()

__isset(  $field) 

Parameters

$field

set_active_leaf()

set_active_leaf(  $leaf_id) 

Parameters

$leaf_id

add_stylesheet()

add_stylesheet(string  $url, string  $media = false) 

Convenience shortcut for adding CSS files

Parameters

string $url

The stylesheet URL

string $media

The media type(s) for the stylesheet, if any

get_workflow()

get_workflow(string  $identifier, array  $options = array()) : \midcom\workflow\dialog

Parameters

string $identifier
array $options

Returns

\midcom\workflow\dialog

set_param()

set_param(string  $name, mixed  $value) 

Set one of the HTTP_Request2 parameters

Parameters

string $name

The parameter's name

mixed $value

The new value

get()

get(string  $url, array  $headers = array(), string  $username = null, string  $password = null) : string

Get contents of given URL

Parameters

string $url

Fully qualified URL

array $headers

Additional HTTP headers

string $username

Username, if any

string $password

Password, if any

Returns

string —

Contents

post()

post(string  $uri, array  $variables, array  $headers = array()) : string

Post variables and get the resulting page

Parameters

string $uri

Fully qualified URL

array $variables

The data to POST (key => value pairs)

array $headers

Additional HTTP headers

Returns

string —

Contents

get_client()

get_client() : \GuzzleHttp\Client

Returns

\GuzzleHttp\Client

send()

send(\GuzzleHttp\Psr7\Request  $request,   $username,   $password) 

Parameters

\GuzzleHttp\Psr7\Request $request
$username
$password