array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'stomp.error.php', 1 => 'Stomp::error', 2 => 'Gets the last stomp error', ), 'up' => array ( 0 => 'class.stomp.php', 1 => 'Stomp', ), 'prev' => array ( 0 => 'stomp.destruct.php', 1 => 'Stomp::__destruct', ), 'next' => array ( 0 => 'stomp.getreadtimeout.php', 1 => 'Stomp::getReadTimeout', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/stomp/stomp/error.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL stomp >= 0.1.0)
Stomp::error -- stomp_error — Gets the last stomp error
Objektorientierter Stil (method):
Prozeduraler Stil:
Gets the last stomp error.
linkNur für prozedurale Aufrufe: Die Stomp-Verbindung, die von stomp_connect() zurückgegeben wurde.
Returns an error string or false if no error occurred.
Beispiel #1 Objektorientierter Stil
<?php
/* connection */
try {
$stomp = new Stomp('tcp://localhost:61613');
} catch(StompException $e) {
die('Connection failed: ' . $e->getMessage());
}
var_dump($stomp->error());
if (!$stomp->abort('unknown-transaction', array('receipt' => 'foo'))) {
var_dump($stomp->error());
}
/* close connection */
unset($stomp);
?>Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
bool(false) string(43) "Invalid transaction id: unknown-transaction"
Beispiel #2 Prozeduraler Stil
<?php
/* connection */
$link = stomp_connect('ssl://localhost:61612');
/* check connection */
if (!$link) {
die('Connection failed: ' . stomp_connect_error());
}
var_dump(stomp_error($link));
if (!stomp_abort($link, 'unknown-transaction', array('receipt' => 'foo'))) {
var_dump(stomp_error($link));
}
/* close connection */
stomp_close($link);
?>Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:
bool(false) string(43) "Invalid transaction id: unknown-transaction"