i5_get_property

 

Get an Easycom server property value.

 

int / string i5_get_property (

int Property,
resource connection )

 

Parameters

Property

Symbolic value of the property to get value of.

 

Property

Description

 

I5_NEW_CONNECTION

This property has sense only when connection was open by i5_pconnect(),

Return values are :

·      0 : The connection was already open by a previous call to i5_pconnect() in a previous script.

·      1 : This is a new connection never used before by another PHP script.

 

 

I5_PRIVATE_CONNECTION

This property has sense only when connection was open by i5_pconnect(),

Return value is the connection ID you have to store in a session variable, and set to option I5_OPTIONS_PRIVATE_CONNECTION on a next i5_pconnect() call.

 

connection

Connection resource - result from i5_connect() or i5_pconnect()

 

 

Returns:

Property value.

Error returned

I5_ERR_PARSEXML

42

Internal error; please contact Aura Equipement; error number 42

I5_ERR_PHP_OPTIONSTYPE

259

The type of " I5_OPTIONS_ALIAS" option must be x and not x

I5_ERR_PHP_OPTIONSNUMBER

260

Option number -1 is unknown.

I5_ERR_PHP_TYPEPARAM

262

Type of element x in parameter -1 must be y. Type z was provided.

I5_ERR_PHP_DESC_EMPTY

310

The description array is empty.

 

 

Details

 

Example

 

 

$conn = i5_pconnect("193.104.118.120", "QPGMR", "PASSWORD");

if (!$conn) {

 $error = i5_error();

 echo " Error during connection<BR>";

 echo "<BR> Error number: ".$error["num"];

 echo "<BR> Error category: ".$error["cat"];

 echo "<BR> Error message: ".$error["msg"];

 echo "<BR> Error description: ".$error["desc"];

 trigger_error("I5 connection fails", E_USER_ERROR);

} else {

 echo " Connection OK <BR>";

 $isnew = i5_get_property(I5_NEW_CONNECTION, $conn);

 if ($isnew) {

  echo " New connection. Do some job initialization <BR>";

  /* leaves connection without closing it. */

  /* Make it available for another script. */

  $ret = i5_close($conn);

  if (!$ret) trigger_error("i5_pclose error : ".i5_errormsg(), E_USER_ERROR);

 } else {

  $ret = i5_pclose($conn);

  if (!$ret) trigger_error("i5_pclose error : ".i5_errormsg(), E_USER_ERROR);

 }

}

echo " I5 disconnected<BR>";

 

 

See also

 

i5_pconnect