PHP Class opensrs\Base

Since: 3.4
Afficher le fichier Open project: opensrs/osrs-toolkit-php Class Usage Examples

Méthodes publiques

Свойство Type Description
$defaultTlds
$requiredFields classes that don't have any fields

Protected Properties

Свойство Type Description
$_opsHandler seconds
$protocol

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

__destruct() public méthode

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

_validateObject() public méthode

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 méthode

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

getConfiguredTlds() public méthode

.. 1. selected tlds 2. supplied default tlds 3. included default tlds.
public getConfiguredTlds ( ) : array
Résultat array tlds

getDomain() public méthode

Get the domain from the dataObject.
public getDomain ( )

hasDomain() public méthode

Does the dataObject have a domain set?
public hasDomain ( ) : boolean
Résultat boolean

isValidField() public méthode

statement in _validateObject
public isValidField ( $value )

is_connected() public méthode

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

send() public méthode

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 méthode

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

setDataObject() public méthode

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