PHP Class opensrs\Ops

Show file Open project: opensrs/osrs-toolkit-php Class Usage Examples

Public Properties

Property Type Description
$CRLF
$_CRLF * indent character
$_MSGCNT
$_MSGTYPE_STD
$_OPS_VERSION
$_OPT
$_SESSID
$_SPACER
$_data
$_last_was_data_block
$_pointers

Public Methods

Method Description
PHP2XML ( $data ) : string Converts a PHP array into an OPS data_block tag.
XML2PHP ( $msg ) : mixed XML Parser that converts an OPS protocol message into a PHP array.
__construct ( $args = false ) Class constructor Initialize variables, logs, etc.
_convertData ( &$array, $indent ) : string Recursivly converts PHP data into XML.
_is_assoc ( &$array ) : boolean Determines if an array is associative or not, since PHP doesn't really distinguish between the two, but Perl/OPS does.
_quoteXMLChars ( $string ) : string Quotes special XML characters.
decode ( $in ) : mixed Accepts an OPS protocol message or an file handle and decodes the data into a PHP array.
encode ( $array ) : string Converts a PHP array into an OPS message.
socketStatus ( &$fh ) : boolean Checks a socket for timeout or EOF.

Method Details

PHP2XML() public method

Converts a PHP array into an OPS data_block tag.
public PHP2XML ( $data ) : string
return string OPS data_block tag

XML2PHP() public method

XML Parser that converts an OPS protocol message into a PHP array.
public XML2PHP ( $msg ) : mixed
return mixed PHP array, or error

__construct() public method

Class constructor Initialize variables, logs, etc.
public __construct ( $args = false )

_convertData() public method

Recursivly converts PHP data into XML.
public _convertData ( &$array, $indent ) : string
return string XML string

_is_assoc() public method

Determines if an array is associative or not, since PHP doesn't really distinguish between the two, but Perl/OPS does.
public _is_assoc ( &$array ) : boolean
return boolean true if the array is associative

_quoteXMLChars() public method

Quotes special XML characters.
public _quoteXMLChars ( $string ) : string
return string quoted string

decode() public method

Accepts an OPS protocol message or an file handle and decodes the data into a PHP array.
public decode ( $in ) : mixed
return mixed PHP array, or error

encode() public method

Converts a PHP array into an OPS message.
public encode ( $array ) : string
return string OPS XML message

socketStatus() public method

Checks a socket for timeout or EOF.
public socketStatus ( &$fh ) : boolean
return boolean true if the socket has timed out or is EOF

Property Details

$CRLF public property

public $CRLF

$_CRLF public property

* indent character
public $_CRLF

$_MSGCNT public property

public $_MSGCNT

$_MSGTYPE_STD public property

public $_MSGTYPE_STD

$_OPS_VERSION public property

public $_OPS_VERSION

$_OPT public property

public $_OPT

$_SESSID public property

public $_SESSID

$_SPACER public property

public $_SPACER

$_data public property

public $_data

$_last_was_data_block public property

public $_last_was_data_block

$_pointers public property

public $_pointers