HTTP_Server
[ class tree: HTTP_Server ] [ index: HTTP_Server ] [ all elements ]

Class: HTTP_Server_File

Source Location: /HTTP_Server-0.4.1/examples/HTTP_Server_File.php

Class Overview

HTTP_Server
   |
   --HTTP_Server_File

This is a basic example of how to use HTTP_Server to build a custom webserver.


Author(s):

Version:

  • 0.4.0

Variables

Methods


Inherited Variables

Inherited Methods

Class: HTTP_Server

HTTP_Server::HTTP_Server()
constructor
HTTP_Server::__construct()
constructor
HTTP_Server::GET()
handle a GET request this method should return an array of the following format:
HTTP_Server::handleBadRequest()
Handler for invalid requests
HTTP_Server::onReceiveData()
data was received, i.e. HTTP request sent
HTTP_Server::POST()
handle a POST request this method should return an array of the following format:
HTTP_Server::start()
start the server

Class Details

[line 42]
This is a basic example of how to use HTTP_Server to build a custom webserver.


[ Top ]


Class Variables

$documentRoot =    "."

[line 48]

document root

Type:   string


[ Top ]



Method Detail

GET   [line 69]

mixed GET( integer $clientId, &$request, array $headers)

handle a GET request this method should return an array of the following format:

array( "code" => 200, "headers" => array( "Content-Type" => "text/plain", "X-Powered-By" => "PEAR" ), "body" => "This is the actual response" )

  • Return: array containing the response or false if the method handles the response
  • See: HTTP_Server::POST()
  • Access: public

Overrides HTTP_Server::GET() (handle a GET request this method should return an array of the following format:)

Parameters:

integer   $clientId   —  id of the client that send the headers
array   $headers   —  request headers
   &$request   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.