X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=extlib%2FStomp%2FFrame.php;h=195e3b627563b7f46cb4698c8a40a37e7c3ea344;hb=f5650806cc0556d93ada1b43b16608ea3695c76a;hp=dc59c1cb7fff04d6906496b39e8395f1e6a445c0;hpb=6be15dfcacfa821566c16e71cc7bc478b2ff9433;p=quix0rs-gnu-social.git diff --git a/extlib/Stomp/Frame.php b/extlib/Stomp/Frame.php index dc59c1cb7f..195e3b6275 100644 --- a/extlib/Stomp/Frame.php +++ b/extlib/Stomp/Frame.php @@ -1,33 +1,29 @@ - - * @author Dejan Bosanac - * @author Michael Caplan - * @version $Revision: 36 $ */ -class Stomp_Frame +class StompFrame { public $command; public $headers = array(); @@ -54,27 +50,27 @@ class Stomp_Frame $this->body = $body; if ($this->command == 'ERROR') { - require_once 'Stomp/Exception.php'; - throw new Stomp_Exception($this->headers['message'], 0, $this->body); + require_once 'Exception.php'; + throw new StompException($this->headers['message'], 0, $this->body); + } + } + + /** + * Convert frame to transportable string + * + * @return string + */ + public function __toString() + { + $data = $this->command . "\n"; + + foreach ($this->headers as $name => $value) { + $data .= $name . ": " . $value . "\n"; } - } - - /** - * Convert frame to transportable string - * - * @return string - */ - public function __toString() - { - $data = $this->command . "\n"; - - foreach ($this->headers as $name => $value) { - $data .= $name . ": " . $value . "\n"; - } - - $data .= "\n"; - $data .= $this->body; - return $data .= "\x00\n"; + + $data .= "\n"; + $data .= $this->body; + return $data .= "\x00"; } } ?> \ No newline at end of file