Class AmfphpIncludedRequest

Description

Implements interfaces:

allows inclusion of an amfPHP entry point script. This is so that a script running on the same server can include the entry point script and execute a request.

The main use is for the service browser. This allows the service browser page to be generated each time, to display php erros at the top, and retrieve any return data as an object rather than as text that would need to be parsed.

It works by setting the required globals describing the request, including the entry point script, and retrieving the response data.

globals are: $amfphpIncludedRequestServiceName $amfphpIncludedRequestMethodName $amfphpIncludedRequestParameters $amfphpIncludedRequestReturnValue

declare and them before including your entry point script. For example:

$amfphpIncludedRequestServiceName = "DiscoveryService"; $amfphpIncludedRequestMethodName = "collect"; $amfphpIncludedRequestParameters = array(); $amfphpIncludedRequestReturnValue = null; require(dirname(__FILE__) . '/../../Amfphp/index.php'); print_r($amfphpIncludedRequestReturnValue);

the plugin considers that if $amfphpIncludedRequestServiceName is set, then the request is an included request and that it must be handled here.

  • author: Ariel Sommeria-Klein

Located in /Amfphp/Plugins/AmfphpIncludedRequest/AmfphpIncludedRequest.php (line 43)


	
			
Method Summary
AmfphpIncludedRequest __construct ([ $config = null])
void deserialize ( $getData,  $postData,  $rawPostData)
this filterHandler (mixed $handler, String $contentType)
array filterHeaders (array $headers,  $contentType)
void handleDeserializedRequest ( $deserializedRequest,  $serviceRouter)
void handleException ( $exception)
void serialize ( $data)
Methods
Constructor __construct (line 50)

constructor.

  • access: public
AmfphpIncludedRequest __construct ([ $config = null])
  • array $config: optional key/value pairs in an associative array. Used to override default configuration values.
deserialize (line 75)
void deserialize ( $getData,  $postData,  $rawPostData)
  • array $getData
  • array $postData
  • $rawPostData
filterHandler (line 65)

if no content type, then returns this.

  • return: or null
  • access: public
this filterHandler (mixed $handler, String $contentType)
  • String $contentType
  • mixed $handler: null at call in gateway.
filterHeaders (line 126)

filter the headers to make sure the content type is set to text/html if the request was handled by the service browser

  • access: public
array filterHeaders (array $headers,  $contentType)
  • array $headers
  • $contentType
handleDeserializedRequest (line 99)
void handleDeserializedRequest ( $deserializedRequest,  $serviceRouter)
handleException (line 107)
void handleException ( $exception)
  • Exception $exception
serialize (line 114)
void serialize ( $data)
  • $data

Documentation generated on Tue, 29 May 2012 23:42:00 +0200 by phpDocumentor 1.4.3