Moodle  2.2.1
http://www.collinsharper.com
webservice_zend_server Class Reference
Inheritance diagram for webservice_zend_server:
Collaboration diagram for webservice_zend_server:

Public Member Functions

 __construct ($authmethod, $zend_class)
 run ()
 exception_handler ($ex)

Static Public Member Functions

static cast_objects_to_array ($param)

Protected Member Functions

 init_service_class ()
 get_virtual_method_code ($function)
 get_phpdoc_type ($keydesc)
 generate_simple_struct_class (external_single_structure $structdesc)
 service_class_method_body ($function, $params)
 init_zend_server ()
 parse_request ()
 send_headers ()
 send_error ($ex=null)
 session_cleanup ($exception=null)

Protected Attributes

 $zend_class
 $zend_server
 $service_class

Detailed Description

Special abstraction of our srvices that allows interaction with stock Zend ws servers.

Author:
Petr Skoda (skodak)

Definition at line 874 of file lib.php.


Constructor & Destructor Documentation

__construct ( authmethod,
zend_class 
)

Contructor

Parameters:
integer$authmethodauthentication method - one of WEBSERVICE_AUTHMETHOD_*

Definition at line 889 of file lib.php.


Member Function Documentation

static cast_objects_to_array ( param) [static]

Recursive function to recurse down into a complex variable and convert all objects to arrays.

Parameters:
mixed$paramvalue to cast
Returns:
mixed Cast value

Definition at line 1188 of file lib.php.

exception_handler ( ex)

Specialised exception handler, we can not use the standard one because it can not just print html to output.

Parameters:
exception$ex
Returns:
void does not return

Definition at line 1256 of file lib.php.

Here is the call graph for this function:

Reimplemented in webservice_soap_server.

Definition at line 1147 of file lib.php.

Here is the caller graph for this function:

get_phpdoc_type ( keydesc) [protected]

Definition at line 1124 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_virtual_method_code ( function) [protected]

returns virtual method code

Parameters:
object$function
Returns:
string PHP code

Definition at line 1041 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

init_service_class ( ) [protected]

Load virtual class needed for Zend api

Returns:
void

Reimplemented in webservice_amf_server.

Definition at line 949 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

init_zend_server ( ) [protected]

Set up zend service class

Returns:
void

Reimplemented in webservice_amf_server, webservice_soap_server, and webservice_xmlrpc_server.

Definition at line 1207 of file lib.php.

Here is the caller graph for this function:

parse_request ( ) [protected]

This method parses the $_POST and $_GET superglobals and looks for the following information: 1/ user authentication - username+password or token (wsusername, wspassword and wstoken parameters)

Returns:
void

Reimplemented in webservice_soap_server.

Definition at line 1218 of file lib.php.

Here is the caller graph for this function:

run ( )

Process request from client.

Parameters:
bool$simpleuse simple authentication
Returns:
void

Implements webservice_server_interface.

Definition at line 899 of file lib.php.

Here is the call graph for this function:

send_error ( ex = null) [protected]

Send the error information to the WS client formatted as XML document.

Parameters:
exception$ex
Returns:
void

Reimplemented in webservice_soap_server.

Definition at line 1276 of file lib.php.

Here is the call graph for this function:

Here is the caller graph for this function:

send_headers ( ) [protected]

Internal implementation - sending of page headers.

Returns:
void

Definition at line 1242 of file lib.php.

Here is the caller graph for this function:

service_class_method_body ( function,
params 
) [protected]

You can override this function in your child class to add extra code into the dynamically created service class. For example it is used in the amf server to cast types of parameters and to cast the return value to the types as specified in the return value description.

Parameters:
stdClass$function
array$params
Returns:
string body of the method for $function ie. everything within the {} of the method declaration.

Reimplemented in webservice_amf_server.

Definition at line 1159 of file lib.php.

Here is the caller graph for this function:

session_cleanup ( exception = null) [protected]

Future hook needed for emulated sessions.

Parameters:
exception$exceptionnull means normal termination, $exception received when WS call failed
Returns:
void

Definition at line 1286 of file lib.php.

Here is the caller graph for this function:


Field Documentation

$service_class [protected]

Definition at line 883 of file lib.php.

$zend_class [protected]

Definition at line 877 of file lib.php.

$zend_server [protected]

Definition at line 880 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations