API Documentation

Json/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_Json
version
$Id: Server.php 22276 2010-05-24 18:31:59Z andyfowler $
Classes
Zend_Json_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_Json_Server

Extends from
Zend_Server_Abstract
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_Json
Constants
VERSION_1
VERSION_2
Properties
$_autoEmitResponse
$_overwriteExistingMethods
$_request
$_response
$_serviceMap
$_smdMethods
$_table
Methods
addFunction
setClass
fault
handle
loadFunctions
setPersistence
setRequest
getRequest
setResponse
getResponse
setAutoEmitResponse
autoEmitResponse
__call
getServiceMap
_addMethodServiceMap
_fixType
_getDefaultParams
_getParams
_getReadyResponse
_getReturnType
_getSmdMethods
_handle

Description

Constants

VERSION_1

 VERSION_1 = '1.0'

Details

value
1.0

VERSION_2

 VERSION_2 = '2.0'

Details

value
2.0

Properties

$_autoEmitResponse

bool $_autoEmitResponse = 'true'

Flag: whether or not to auto-emit the response

Details

$_autoEmitResponse
bool
visibility
protected
default
true
final
false
static
false

$_overwriteExistingMethods

bool $_overwriteExistingMethods = 'true'

Details

$_overwriteExistingMethods
bool
Flag; allow overwriting existing methods when creating server definition
visibility
protected
default
true
final
false
static
false

$_request

Zend_Json_Server_Request $_request = ''

Request object

Details

$_request
Zend_Json_Server_Request
visibility
protected
default
final
false
static
false

$_response

Zend_Json_Server_Response $_response = ''

Response object

Details

$_response
Zend_Json_Server_Response
visibility
protected
default
final
false
static
false

$_serviceMap

Zend_Json_Server_Smd $_serviceMap = ''

SMD object

Details

$_serviceMap
Zend_Json_Server_Smd
visibility
protected
default
final
false
static
false

$_smdMethods

array $_smdMethods = ''

SMD class accessors

Details

$_smdMethods
array
visibility
protected
default
final
false
static
false

$_table

Zend_Server_Description $_table = ''

Details

$_table
Zend_Server_Description
visibility
protected
default
final
false
static
false

Methods

__call

__call( string $method, array $args ) : mixed

Overload to accessors of SMD object

Arguments
$method
string
$args
array
Output
mixed
Details
visibility
public
final
false
static
false

_addMethodServiceMap

_addMethodServiceMap( Zend_Server_Reflection_Function $method ) : void

Add service method to service map

Arguments
$method
Zend_Server_Reflection_Function
Details
visibility
protected
final
false
static
false

_fixType

_fixType( string $type ) : string

Translate PHP type to JSON type

Arguments
$type
string
Output
string
Details
visibility
protected
final
false
static
false

_getDefaultParams

_getDefaultParams( array $args, array $params ) : array

Get default params from signature

Arguments
$args
array
$params
array
Output
array
Details
visibility
protected
final
false
static
false

_getParams

_getParams( Zend_Server_Reflection_Function_Abstract $method ) : string|array

Get method param type

Arguments
$method
Zend_Server_Reflection_Function_Abstract
Output
string|array
Details
visibility
protected
final
false
static
false

_getReadyResponse

_getReadyResponse( ) : Zend_Json_Server_Response

Set response state

Details
visibility
protected
final
false
static
false

_getReturnType

_getReturnType( Zend_Server_Reflection_Function_Abstract $method ) : string|array

Get method return type

Arguments
$method
Zend_Server_Reflection_Function_Abstract
Output
string|array
Details
visibility
protected
final
false
static
false

_getSmdMethods

_getSmdMethods( ) : array

Retrieve list of allowed SMD methods for proxying

Output
array
Details
visibility
protected
final
false
static
false

_handle

_handle( ) : void

Internal method for handling request

Details
visibility
protected
final
false
static
false

addFunction

addFunction( string|array $function, string $namespace ) : Zend_Json_Server

Attach a function or callback to the server

Arguments
$function
stringarray
Valid PHP callback
$namespace
string
Ignored
Details
visibility
public
final
false
static
false

autoEmitResponse

autoEmitResponse( ) : bool

Will we auto-emit the response?

Output
bool
Details
visibility
public
final
false
static
false

fault

fault( string $fault = null, int $code = 404,  $data = null ) : false

Indicate fault response

Arguments
$fault
string
$code
int
$data
Output
false
Details
visibility
public
final
false
static
false

getRequest

getRequest( ) : Zend_Json_Server_Request

Get JSON-RPC request object

Details
visibility
public
final
false
static
false

getResponse

getResponse( ) : Zend_Json_Server_Response

Get response object

Details
visibility
public
final
false
static
false

getServiceMap

getServiceMap( ) : Zend_Json_Server_Smd

Retrieve SMD object

Details
visibility
public
final
false
static
false

handle

handle( Zend_Json_Server_Request $request = false ) : null|Zend_Json_Server_Response

Handle request

Arguments
$request
Zend_Json_Server_Request
Details
visibility
public
final
false
static
false

loadFunctions

loadFunctions( array|Zend_Server_Definition $definition ) : void

Load function definitions

Arguments
$definition
arrayZend_Server_Definition
Details
visibility
public
final
false
static
false

setAutoEmitResponse

setAutoEmitResponse( bool $flag ) : Zend_Json_Server

Set flag indicating whether or not to auto-emit response

Arguments
$flag
bool
Details
visibility
public
final
false
static
false

setClass

setClass( string $class, string $namespace, mixed $argv = null ) : Zend_Json_Server

Register a class with the server

Arguments
$class
string
$namespace
string
Ignored
$argv
mixed
Ignored
Details
visibility
public
final
false
static
false

setPersistence

setPersistence(  $mode ) :
Arguments
$mode
Details
visibility
public
final
false
static
false

setRequest

setRequest( Zend_Json_Server_Request $request ) : Zend_Json_Server

Set request object

Arguments
$request
Zend_Json_Server_Request
Details
visibility
public
final
false
static
false

setResponse

setResponse( Zend_Json_Server_Response $response ) : Zend_Json_Server

Set response object

Arguments
$response
Zend_Json_Server_Response
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.