PHP Class opensrs\Base

Since: 3.4
Mostrar archivo Open project: opensrs/osrs-toolkit-php Class Usage Examples

Public Properties

Property Type Description
$defaultTlds
$requiredFields classes that don't have any fields

Protected Properties

Property Type Description
$_opsHandler seconds
$protocol

Public Methods

Method Description
__construct ( ) openSRS_base object constructor.
__destruct ( ) openSRS_base object destructor.
_validateObject ( $dataObject, $requiredFields = null ) Method for any shared validation that is applicable to all API calls. Checks API call class for requiredFields array and checks all fields on $dataObject against it to make sure all fields in requiredFields are set and have a value THIS DOES NOT VALIDATE THAT THE VALUE IS VALID!
convertArray2Formatted ( $type = '', $data = '' )
getConfiguredTlds ( ) : array Get configured tlds for domain call Will use (in order of preference).
getDomain ( ) Get the domain from the dataObject.
hasDomain ( ) : boolean Does the dataObject have a domain set?
isValidField ( $value ) statement in _validateObject
is_connected ( ) : boolean Method to check if a socket connection exists.
send ( $dataObject, $returnFullResponse = true ) Send the oSRS API request, set action, object and protocol based on the call being made (so we don't have to set it in each call class), and run any custom response handling if the function 'customResponseHandling' exists on $obj, the class for that specific API call.
send_cmd ( string $request ) : string Method to send a command to the server.
setDataObject ( $format, $dataObject )

Private Methods

Method Description
_verifySystemProperties ( ) Method to check the PHP version and OpenSSL PHP lib installation.
close_socket ( ) Method to close the socket connection.
init_socket ( ) : boolean Method to initialize a socket connection to the OpenSRS server.
readData ( &$fh, $timeout = 5 ) : mixed Reads data from a socket.
readHeader ( $fh, $timeout = 5 ) : hash Reads header data.
read_data ( ) : string Method to read data from the buffer stream.
send_data ( string $message ) : string Method to send data.
writeData ( &$fh, string $msg ) Writes a message to a socket (buffered IO).

Method Details

__construct() public method

Closes an existing socket connection, if we have one
Since: 3.1
public __construct ( )

__destruct() public method

Closes an existing socket connection, if we have one
Since: 3.4
public __destruct ( )

_validateObject() public method

Method for any shared validation that is applicable to all API calls. Checks API call class for requiredFields array and checks all fields on $dataObject against it to make sure all fields in requiredFields are set and have a value THIS DOES NOT VALIDATE THAT THE VALUE IS VALID!
public _validateObject ( $dataObject, $requiredFields = null )

convertArray2Formatted() public method

public convertArray2Formatted ( $type = '', $data = '' )

getConfiguredTlds() public method

.. 1. selected tlds 2. supplied default tlds 3. included default tlds.
public getConfiguredTlds ( ) : array
return array tlds

getDomain() public method

Get the domain from the dataObject.
public getDomain ( )

hasDomain() public method

Does the dataObject have a domain set?
public hasDomain ( ) : boolean
return boolean

isValidField() public method

statement in _validateObject
public isValidField ( $value )

is_connected() public method

Method to check if a socket connection exists.
Since: 3.4
public is_connected ( ) : boolean
return boolean True if connected

send() public method

Send the oSRS API request, set action, object and protocol based on the call being made (so we don't have to set it in each call class), and run any custom response handling if the function 'customResponseHandling' exists on $obj, the class for that specific API call.
public send ( $dataObject, $returnFullResponse = true )

send_cmd() public method

Method to send a command to the server.
Since: 3.1
public send_cmd ( string $request ) : string
$request string Raw XML request
return string $data Raw XML response

setDataObject() public method

public setDataObject ( $format, $dataObject )

Property Details

$_opsHandler protected_oe property

seconds
protected $_opsHandler

$defaultTlds public_oe property

public $defaultTlds

$protocol protected_oe property

protected $protocol

$requiredFields public_oe property

classes that don't have any fields
public $requiredFields