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.

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 = "AmfphpDiscoveryService"; $amfphpIncludedRequestMethodName = "discover"; $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.

package Amfphp_Plugins_AmfphpIncludedRequest
author Ariel Sommeria-Klein

 Methods

constructor.

__construct(array $config) 

Parameters

$config

array

optional key/value pairs in an associative array. Used to override default configuration values.

deserialize

deserialize(array $getData, array $postData, string $rawPostData) : string
see \Amfphp_Core_Common_IDeserializer

Parameters

$getData

array

$postData

array

$rawPostData

string

Returns

string

if no content type, then returns this.

filterHandler(mixed $handler, String $contentType) : \this

Parameters

$handler

mixed

null at call in gateway.

$contentType

String

Returns

\thisor null

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

filterHeaders(array $headers, string $contentType) : array

Parameters

$headers

array

$contentType

string

Returns

array

call service

handleDeserializedRequest(array $deserializedRequest, \Amfphp_Core_Common_ServiceRouter $serviceRouter) : \the

This should not handle exceptions, as this is done separately

see \Amfphp_Core_Common_IDeserializedRequestHandler

Parameters

$deserializedRequest

array

Returns

\theservice call response

handle exception

handleException(\Exception $exception) : \Exception
see \Amfphp_Core_Common_IExceptionHandler

Parameters

$exception

\Exception

Returns

set the return data in global $amfphpIncludedRequestReturnValue

serialize(mixed $data) : string

The return type is noted as a String, but is a binary stream. echo it to the output buffer

see \Amfphp_Core_Common_ISerializer

Parameters

$data

mixed

Returns

stringthe encoded JSON string sent to JavaScript