Json/Server.php

Show: PublicProtectedPrivateinherited
Table of Contents
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.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Json  
Version
$Id$  

\Zend_Json_Server

Package: Zend_Json
Zend_Server_Abstract
Parent(s)
\Zend_Server_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

>VConstant  VERSION_1 = '1.0'
>VConstant  VERSION_2 = '2.0'

Properties

>VPropertyprotectedbool $_autoEmitResponse = true
Flag: whether or not to auto-emit the response
Default valuetrueDetails
Type
bool
>VPropertyprotectedbool $_overwriteExistingMethods = true

Flag; allow overwriting existing methods when creating server definition

Default valuetrueDetails
Type
bool
>VPropertyprotected\Zend_Json_Server_Request $_request
Request object
>VPropertyprotected\Zend_Json_Server_Response $_response
Response object
>VPropertyprotected\Zend_Json_Server_Smd $_serviceMap
SMD object
>VPropertyprotectedarray $_smdMethods
SMD class accessors
Details
Type
array
>VPropertyprotected\Zend_Server_Description $_table

Methods

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

Overload to accessors of SMD object

Parameters
NameTypeDescription
$methodstring
$argsarray
Returns
TypeDescription
mixed
methodprotected_addMethodServiceMap(\Zend_Server_Reflection_Function $method) : void

Add service method to service map

Parameters
NameTypeDescription
$method\Zend_Server_Reflection_Function
methodprotected_fixType(string $type) : string

Translate PHP type to JSON type

Parameters
NameTypeDescription
$typestring
Returns
TypeDescription
string
methodprotected_getDefaultParams(array $args, array $params) : array

Get default params from signature

Parameters
NameTypeDescription
$argsarray
$paramsarray
Returns
TypeDescription
array
methodprotected_getParams(\Zend_Server_Reflection_Function_Abstract $method) : string | array

Get method param type

Parameters
NameTypeDescription
$method\Zend_Server_Reflection_Function_Abstract
Returns
TypeDescription
string | array
methodprotected_getReadyResponse() : \Zend_Json_Server_Response

Set response state

Returns
TypeDescription
\Zend_Json_Server_Response
methodprotected_getReturnType(\Zend_Server_Reflection_Function_Abstract $method) : string | array

Get method return type

Parameters
NameTypeDescription
$method\Zend_Server_Reflection_Function_Abstract
Returns
TypeDescription
string | array
methodprotected_getSmdMethods() : array

Retrieve list of allowed SMD methods for proxying

Returns
TypeDescription
array
methodprotected_handle() : void

Internal method for handling request

methodpublicaddFunction(string | array $function, string $namespace = '') : \Zend_Json_Server

Attach a function or callback to the server

Parameters
NameTypeDescription
$functionstring | array

Valid PHP callback

$namespacestring

Ignored

Returns
TypeDescription
\Zend_Json_Server
methodpublicautoEmitResponse() : bool

Will we auto-emit the response?

Returns
TypeDescription
bool
methodpublicfault(string $fault = null, int $code = 404,  $data = null) : false

Indicate fault response

Parameters
NameTypeDescription
$faultstring
$codeint
$data
Returns
TypeDescription
false
methodpublicgetRequest() : \Zend_Json_Server_Request

Get JSON-RPC request object

Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicgetResponse() : \Zend_Json_Server_Response

Get response object

Returns
TypeDescription
\Zend_Json_Server_Response
methodpublicgetServiceMap() : \Zend_Json_Server_Smd

Retrieve SMD object

Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublichandle(\Zend_Json_Server_Request $request = false) : null | \Zend_Json_Server_Response

Handle request

Parameters
NameTypeDescription
$request\Zend_Json_Server_Request
Returns
TypeDescription
null | \Zend_Json_Server_Response
methodpublicloadFunctions(array | \Zend_Server_Definition $definition) : void

Load function definitions

Parameters
NameTypeDescription
$definitionarray | \Zend_Server_Definition
methodpublicsetAutoEmitResponse(bool $flag) : \Zend_Json_Server

Set flag indicating whether or not to auto-emit response

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Json_Server
methodpublicsetClass(string $class, string $namespace = '', mixed $argv = null) : \Zend_Json_Server

Register a class with the server

Parameters
NameTypeDescription
$classstring
$namespacestring

Ignored

$argvmixed

Ignored

Returns
TypeDescription
\Zend_Json_Server
methodpublicsetPersistence( $mode) : void

Parameters
NameTypeDescription
$mode
methodpublicsetRequest(\Zend_Json_Server_Request $request) : \Zend_Json_Server

Set request object

Parameters
NameTypeDescription
$request\Zend_Json_Server_Request
Returns
TypeDescription
\Zend_Json_Server
methodpublicsetResponse(\Zend_Json_Server_Response $response) : \Zend_Json_Server

Set response object

Parameters
NameTypeDescription
$response\Zend_Json_Server_Response
Returns
TypeDescription
\Zend_Json_Server
Documentation was generated by phpDocumentor 2.2.0 .