Author: chabotc
Date: Sat Sep 13 04:14:26 2008
New Revision: 694930
URL: http://svn.apache.org/viewvc?rev=694930&view=rev
Log:
Removed multipart batching code from converters
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
incubator/shindig/trunk/php/src/social/converters/OutputConverter.php
incubator/shindig/trunk/php/src/social/converters/OutputXmlConverter.php
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php?rev=694930&r1=694929&r2=694930&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
(original)
+++ incubator/shindig/trunk/php/src/social/converters/OutputAtomConverter.php
Sat Sep 13 04:14:26 2008
@@ -126,17 +126,7 @@
function outputBatch(Array $responses, SecurityToken $token)
{
- $this->boundryHeaders();
- foreach ($responses as $response) {
- $request = $response['request'];
- $response = $response['response'];
- // output buffering supports multiple levels of it..
it's a nice feature to abuse :)
- ob_start();
- $this->outputResponse($response, $request);
- $part = ob_get_contents();
- ob_end_clean();
- $this->outputPart($part, $response->getError());
- }
+ throw new Exception("Atom batch not supported");
}
/**
Modified: incubator/shindig/trunk/php/src/social/converters/OutputConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/converters/OutputConverter.php?rev=694930&r1=694929&r2=694930&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/converters/OutputConverter.php
(original)
+++ incubator/shindig/trunk/php/src/social/converters/OutputConverter.php Sat
Sep 13 04:14:26 2008
@@ -27,44 +27,4 @@
abstract function outputResponse(ResponseItem $responseItem,
RestRequestItem $requestItem);
abstract function outputBatch(Array $responses, SecurityToken $token);
-
- /**
- * Output the multipart/mixed headers and returns the boundry token used
- *
- */
- public function boundryHeaders()
- {
- $this->boundry = '--batch-' . md5(rand(0, 32000));
- header("HTTP/1.1 200 OK", true);
- header("Content-Type: multipart/mixed;
boundary=$this->boundry", true);
- }
-
- public function outputPart($part, $code)
- {
- $boundryHeader = "{$this->boundry}\r\n" . "Content-Type:
application/http;version=1.1\r\n" . "Content-Transfer-Encoding: binary\r\n\r\n";
- echo $boundryHeader;
- switch ($code) {
- case BAD_REQUEST:
- $code = '400 Bad Request';
- break;
- case UNAUTHORIZED:
- $code = '401 Unauthorized';
- break;
- case FORBIDDEN:
- $code = '403 Forbidden';
- break;
- case FORBIDDEN:
- $code = '404 Not Found';
- break;
- case NOT_IMPLEMENTED:
- $code = '501 Not Implemented';
- break;
- case INTERNAL_ERROR:
- default:
- $code = '200 OK';
- break;
- }
- echo "$code\r\n\r\n";
- echo $part . "\n";
- }
}
Modified:
incubator/shindig/trunk/php/src/social/converters/OutputXmlConverter.php
URL:
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/social/converters/OutputXmlConverter.php?rev=694930&r1=694929&r2=694930&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/social/converters/OutputXmlConverter.php
(original)
+++ incubator/shindig/trunk/php/src/social/converters/OutputXmlConverter.php
Sat Sep 13 04:14:26 2008
@@ -68,17 +68,7 @@
function outputBatch(Array $responses, SecurityToken $token)
{
- $this->boundryHeaders();
- foreach ($responses as $response) {
- $request = $response['request'];
- $response = $response['response'];
- // output buffering supports multiple levels of it..
it's a nice feature to abuse :)
- ob_start();
- $this->outputResponse($response, $request);
- $part = ob_get_contents();
- ob_end_clean();
- $this->outputPart($part, $response->getError());
- }
+ throw new Exception("XML batch not supported");
}
/**