API Documentation

Rest/Server.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Rest
subpackage
Server
version
$Id: Server.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Rest_Server

Description

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Zend_Rest_Server

Implements
Zend_Server_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Rest
subpackage
Server
Properties
$_args
$_encoding
$_functions
$_headers
$magicMethods
$_method
$_reflection
$_returnResponse
Methods
__construct
setEncoding
getEncoding
lowerCase
returnResponse
handle
setClass
_handleStruct
_structValue
_handleScalar
fault
getHeaders
addFunction
getFunctions
loadFunctions
setPersistence
_callStaticMethod
_callObjectMethod

Description

Properties

$_args

array $_args = 'array'

Class Constructor Args

Details

$_args
array
visibility
protected
default
array
final
false
static
false

$_encoding

string $_encoding = 'UTF-8'

Details

$_encoding
string
Encoding
visibility
protected
default
UTF-8
final
false
static
false

$_functions

array $_functions = 'array'

Details

$_functions
array
An array of Zend_Server_Reflect_Method
visibility
protected
default
array
final
false
static
false

$_headers

array $_headers = 'array'

Details

$_headers
array
Array of headers to send
visibility
protected
default
array
final
false
static
false

$_method

string $_method = ''

Details

$_method
string
Current Method
visibility
protected
default
final
false
static
false

$_reflection

Zend_Server_Reflection $_reflection = 'null'

Details

$_reflection
Zend_Server_Reflection
visibility
protected
default
null
final
false
static
false

$_returnResponse

boolean $_returnResponse = 'false'

Whether or not {@link handle()} should send output or return the response.

Details

$_returnResponse
boolean
Defaults to false
visibility
protected
default
false
final
false
static
false

$magicMethods

array $magicMethods = 'array'

Details

$magicMethods
array
PHP's Magic Methods, these are ignored
visibility
protected
default
array
final
false
static
true

Methods

__construct

__construct( ) :

Constructor

Details
visibility
public
final
false
static
false

_callObjectMethod

_callObjectMethod( string $class, array $args ) : mixed

Call an instance method of an object

Arguments
$class
string
$args
array
Output
mixed
Details
visibility
protected
final
false
static
false
throws
For invalid class name

_callStaticMethod

_callStaticMethod( string $class, array $args ) : mixed

Call a static class method and return the result

Arguments
$class
string
$args
array
Output
mixed
Details
visibility
protected
final
false
static
false

_handleScalar

_handleScalar( string|int|boolean $value ) : string

Handle a single value

Arguments
$value
stringintboolean
Result value
Output
string
XML Response
Details
visibility
protected
final
false
static
false

_handleStruct

_handleStruct( array|object $struct ) : string

Handle an array or object result

Arguments
$struct
arrayobject
Result Value
Output
string
XML Response
Details
visibility
protected
final
false
static
false

_structValue

_structValue( mixed $struct, DOMDocument $dom, DOMElement $parent ) : void

Recursively iterate through a struct

Recursively iterates through an associative array or object's properties to build XML response.

Arguments
$struct
mixed
$dom
DOMDocument
$parent
DOMElement
Details
visibility
protected
final
false
static
false

addFunction

addFunction( string $function, string $namespace ) :

Implement Zend_Server_Interface::addFunction()

Arguments
$function
string
Function Name
$namespace
string
Function namespace (unused)
Details
visibility
public
final
false
static
false

fault

fault(  $exception = null, int $code = null ) : DOMDocument

Implement Zend_Server_Interface::fault()

Creates XML error response, returning DOMDocument with response.

Arguments
$exception
$code
int
Error Code
Output
DOMDocument
Details
visibility
public
final
false
static
false

getEncoding

getEncoding( ) : string

Get XML encoding

Output
string
Details
visibility
public
final
false
static
false

getFunctions

getFunctions( ) : array

Implement Zend_Server_Interface::getFunctions()

Output
array
An array of Zend_Server_Reflection_Method's
Details
visibility
public
final
false
static
false

getHeaders

getHeaders( ) : array

Retrieve any HTTP extra headers set by the server

Output
array
Details
visibility
public
final
false
static
false

handle

handle( array $request = false ) : string|void

Implement Zend_Server_Interface::handle()

Arguments
$request
array
Output
string|void
Details
visibility
public
final
false
static
false
throws

loadFunctions

loadFunctions( array $functions ) :

Implement Zend_Server_Interface::loadFunctions()

Arguments
$functions
array
Details
visibility
public
final
false
static
false
todo
Implement

lowerCase

lowerCase( string $value, string $key ) : string

Lowercase a string

Lowercase's a string by reference

Arguments
$value
string
$key
string
Output
string
Lower cased string
Details
visibility
public
final
false
static
true

returnResponse

returnResponse( boolean $flag = null ) : boolean|Zend_Rest_Server

Whether or not to return a response

If called without arguments, returns the value of the flag. If called with an argument, sets the flag.

When 'return response' is true, {@link handle()} will not send output, but will instead return the response from the dispatched function/method.

Arguments
$flag
boolean
Output
boolean|Zend_Rest_Server
Returns Zend_Rest_Server when used to set the flag; returns boolean flag value otherwise.
Details
visibility
public
final
false
static
false

setClass

setClass( string $classname, string $namespace, array $argv = array ) :

Implement Zend_Server_Interface::setClass()

Arguments
$classname
string
Class name
$namespace
string
Class namespace (unused)
$argv
array
An array of Constructor Arguments
Details
visibility
public
final
false
static
false

setEncoding

setEncoding( string $encoding ) : Zend_Rest_Server

Set XML encoding

Arguments
$encoding
string
Details
visibility
public
final
false
static
false

setPersistence

setPersistence( int $mode ) :

Implement Zend_Server_Interface::setPersistence()

Arguments
$mode
int
Details
visibility
public
final
false
static
false
todo
Implement
Documentation was generated by DocBlox.