API Documentation

Zend/Json/Server.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Json  
Version
$Id: Server.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Json_Server

Package: Zend\Json

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

Constants

Constant  VERSION_1 = '1.0'
Constant  VERSION_2 = '2.0'

Properties

Propertyprotectedbool  $_autoEmitResponse= 'true'

Flag: whether or not to auto-emit the response

Default valuetrueDetails
Type
bool
Propertyprotectedbool  $_overwriteExistingMethods= 'true'

Flag; allow overwriting existing methods when creating server definition
Default valuetrueDetails
Type
bool
Propertyprotected\Zend_Json_Server_Request  $_request= ''

Request object

Propertyprotected\Zend_Json_Server_Response  $_response= ''

Response object

Propertyprotected\Zend_Json_Server_Smd  $_serviceMap= ''

SMD object

Details
Type
\Zend_Json_Server_Smd
Propertyprotectedarray  $_smdMethods= ''

SMD class accessors

Details
Type
array
Propertyprotected\Zend_Server_Description  $_table= ''

Details
Type
\Zend_Server_Description

Methods

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

Overload to accessors of SMD object

Parameters
Name Type Description
$method string
$args array
Returns
Type Description
mixed
methodprotected_addMethodServiceMap( \Zend_Server_Reflection_Function $method ) : void

Add service method to service map

Parameters
Name Type Description
$method \Zend_Server_Reflection_Function
methodprotected_fixType( string $type ) : string

Translate PHP type to JSON type

Parameters
Name Type Description
$type string
Returns
Type Description
string
methodprotected_getDefaultParams( array $args, array $params ) : array

Get default params from signature

Parameters
Name Type Description
$args array
$params array
Returns
Type Description
array
methodprotected_getParams( \Zend_Server_Reflection_Function_Abstract $method ) : string|array

Get method param type

Parameters
Name Type Description
$method \Zend_Server_Reflection_Function_Abstract
Returns
Type Description
string|array
methodprotected_getReadyResponse( ) : \Zend_Json_Server_Response

Set response state

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

Get method return type

Parameters
Name Type Description
$method \Zend_Server_Reflection_Function_Abstract
Returns
Type Description
string|array
methodprotected_getSmdMethods( ) : array

Retrieve list of allowed SMD methods for proxying

Returns
Type Description
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
Name Type Description
$function string|array

Valid PHP callback

$namespace string

Ignored

Returns
Type Description
\Zend_Json_Server
methodpublicautoEmitResponse( ) : bool

Will we auto-emit the response?

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

Indicate fault response

Parameters
Name Type Description
$fault string
$code int
$data
Returns
Type Description
false
methodpublicgetRequest( ) : \Zend_Json_Server_Request

Get JSON-RPC request object

Returns
Type Description
\Zend_Json_Server_Request
methodpublicgetResponse( ) : \Zend_Json_Server_Response

Get response object

Returns
Type Description
\Zend_Json_Server_Response
methodpublicgetServiceMap( ) : \Zend_Json_Server_Smd

Retrieve SMD object

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

Handle request

Parameters
Name Type Description
$request \Zend_Json_Server_Request
Returns
Type Description
null|\Zend_Json_Server_Response
methodpublicloadFunctions( array|\Zend_Server_Definition $definition ) : void

Load function definitions

Parameters
Name Type Description
$definition array|\Zend_Server_Definition
methodpublicsetAutoEmitResponse( bool $flag ) : \Zend_Json_Server

Set flag indicating whether or not to auto-emit response

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_Json_Server
methodpublicsetClass( string $class, string $namespace = '', mixed $argv = null ) : \Zend_Json_Server

Register a class with the server

Parameters
Name Type Description
$class string
$namespace string

Ignored

$argv mixed

Ignored

Returns
Type Description
\Zend_Json_Server
methodpublicsetPersistence(  $mode ) : void

Parameters
Name Type Description
$mode
methodpublicsetRequest( \Zend_Json_Server_Request $request ) : \Zend_Json_Server

Set request object

Parameters
Name Type Description
$request \Zend_Json_Server_Request
Returns
Type Description
\Zend_Json_Server
methodpublicsetResponse( \Zend_Json_Server_Response $response ) : \Zend_Json_Server

Set response object

Parameters
Name Type Description
$response \Zend_Json_Server_Response
Returns
Type Description
\Zend_Json_Server
Documentation was generated by DocBlox 0.15.1.