Overview

Packages

  • Controller

Classes

  • Horde_Controller_Base
  • Horde_Controller_Exception
  • Horde_Controller_Filter_Gzip
  • Horde_Controller_FilterRunner
  • Horde_Controller_Null
  • Horde_Controller_Request_Http
  • Horde_Controller_Request_Mock
  • Horde_Controller_Request_Null
  • Horde_Controller_Response
  • Horde_Controller_ResponseWriter_Web
  • Horde_Controller_ResponseWriter_WebDebug
  • Horde_Controller_Runner
  • Horde_Controller_SettingsExporter_Default
  • Horde_Controller_UrlWriter

Interfaces

  • Horde_Controller
  • Horde_Controller_FilterCollection
  • Horde_Controller_PostFilter
  • Horde_Controller_PreFilter
  • Horde_Controller_Request
  • Horde_Controller_RequestConfiguration
  • Horde_Controller_ResponseWriter
  • Horde_Controller_SettingsExporter
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * @category Horde
 4:  * @package  Controller
 5:  * @author   James Pepin <james@bluestatedigital.com>
 6:  * @license  http://www.horde.org/licenses/bsd BSD
 7:  */
 8: class Horde_Controller_ResponseWriter_WebDebug implements Horde_Controller_ResponseWriter
 9: {
10:     public function writeResponse(Horde_Controller_Response $response)
11:     {
12:         $headerHtml = '<div><strong>Headers:</strong><pre>';
13:         $headers = $response->getHeaders();
14:         foreach ($headers as $key => $value) {
15:             $headerHtml .= htmlspecialchars("$key: $value\n");
16:         }
17:         echo $headerHtml . '</pre></div>';
18: 
19:         if (isset($headers['Location'])) {
20:             echo '<p>Redirect To: <a href="' . htmlspecialchars($headers['Location']) . '">' . htmlspecialchars($headers['Location']) . '</a></p>';
21:         }
22: 
23:         $body = $response->getBody();
24:         if (is_resource($body)) {
25:             $body = stream_get_contents($body);
26:         }
27:         if (isset($headers['Content-Encoding']) && $headers['Content-Encoding'] == 'gzip') {
28:             // Strip off the header and inflate it
29:             echo gzinflate(substr($body, 10));
30:         } else {
31:             echo $body;
32:         }
33:     }
34: }
35: 
API documentation generated by ApiGen