]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - extlib/Stomp/Frame.php
Switch autoloader from '__autoload' magic function name to registering our function...
[quix0rs-gnu-social.git] / extlib / Stomp / Frame.php
index 9fd97b4f5f766cd85b1db652f6286026e5d22b2c..195e3b627563b7f46cb4698c8a40a37e7c3ea344 100644 (file)
@@ -1,81 +1,76 @@
-<?php
-/**
- *
- * Copyright 2005-2006 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* vim: set expandtab tabstop=3 shiftwidth=3: */
-
-/**
- * Stomp Frames are messages that are sent and received on a StompConnection.
- *
- * @package Stomp
- * @author Hiram Chirino <hiram@hiramchirino.com>
- * @author Dejan Bosanac <dejan@nighttale.net>
- * @author Michael Caplan <mcaplan@labnet.net>
- * @version $Revision: 36 $
- */
-class Stomp_Frame
-{
-    public $command;
-    public $headers = array();
-    public $body;
-    
-    /**
-     * Constructor
-     *
-     * @param string $command
-     * @param array $headers
-     * @param string $body
-     */
-    public function __construct ($command = null, $headers = null, $body = null)
-    {
-        $this->_init($command, $headers, $body);
-    }
-    
-    protected function _init ($command = null, $headers = null, $body = null)
-    {
-        $this->command = $command;
-        if ($headers != null) {
-            $this->headers = $headers;
-        }
-        $this->body = $body;
-        
-        if ($this->command == 'ERROR') {
-            require_once 'Stomp/Exception.php';
-            throw new Stomp_Exception($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";
-        }
-        
-        $data .= "\n";
-        $data .= $this->body;
-        $data .= "\x00\n"; // Should there really be a linefeed here?
-        return $data;
-    }
-}
+<?php\r
+/**\r
+ *\r
+ * Copyright 2005-2006 The Apache Software Foundation\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+/* vim: set expandtab tabstop=3 shiftwidth=3: */\r
+\r
+/**\r
+ * Stomp Frames are messages that are sent and received on a stomp connection.\r
+ *\r
+ * @package Stomp\r
+ */\r
+class StompFrame\r
+{\r
+    public $command;\r
+    public $headers = array();\r
+    public $body;\r
+    \r
+    /**\r
+     * Constructor\r
+     *\r
+     * @param string $command\r
+     * @param array $headers\r
+     * @param string $body\r
+     */\r
+    public function __construct ($command = null, $headers = null, $body = null)\r
+    {\r
+        $this->_init($command, $headers, $body);\r
+    }\r
+    \r
+    protected function _init ($command = null, $headers = null, $body = null)\r
+    {\r
+        $this->command = $command;\r
+        if ($headers != null) {\r
+            $this->headers = $headers;\r
+        }\r
+        $this->body = $body;\r
+        \r
+        if ($this->command == 'ERROR') {\r
+            require_once 'Exception.php';\r
+            throw new StompException($this->headers['message'], 0, $this->body);\r
+        }\r
+    }\r
+    \r
+    /**\r
+     * Convert frame to transportable string\r
+     *\r
+     * @return string\r
+     */\r
+    public function __toString()\r
+    {\r
+        $data = $this->command . "\n";\r
+        \r
+        foreach ($this->headers as $name => $value) {\r
+            $data .= $name . ": " . $value . "\n";\r
+        }\r
+        \r
+        $data .= "\n";\r
+        $data .= $this->body;\r
+        return $data .= "\x00";\r
+    }\r
+}\r
 ?>
\ No newline at end of file