addFilter(Amfphp_Core_Gateway::FILTER_DESERIALIZER, $this, "filterHandler"); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_DESERIALIZED_REQUEST_HANDLER, $this, "filterHandler"); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_EXCEPTION_HANDLER, $this, "filterHandler"); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_SERIALIZER, $this, "filterHandler"); $filterManager->addFilter(Amfphp_Core_Gateway::FILTER_HEADERS, $this, "filterHeaders"); } /** * if no content type, then returns this. * @param mixed null at call in gateway. * @param String $contentType * @return this or null */ public function filterHandler($handler, $contentType) { if (!$contentType || $contentType == self::CONTENT_TYPE) { return $this; } } /** * deserialize * @see Amfphp_Core_Common_IDeserializer * @param array $getData * @param array $postData * @param string $rawPostData * @return string */ public function deserialize(array $getData, array $postData, $rawPostData) { $ret = new stdClass(); return $ret; } /** * handle deserialized request * @see Amfphp_Core_Common_IDeserializedRequestHandler * @param mixed $deserializedRequest * @param Amfphp_Core_Common_ServiceRouter $serviceRouter * @return mixed */ public function handleDeserializedRequest($deserializedRequest, Amfphp_Core_Common_ServiceRouter $serviceRouter) { } /** * handle exception * @see Amfphp_Core_Common_IExceptionHandler * @param Exception $exception */ public function handleException(Exception $exception) { } /** * serialize. just includes index.html * @see Amfphp_Core_Common_ISerializer * @param mixed $data * @return mixed */ public function serialize($data) { include(dirname(__FILE__) . "/index.html"); } /** * filter the headers to make sure the content type is set to text/html if the request was handled by the service browser * @param array $headers * @param string $contentType * @return array */ public function filterHeaders($headers, $contentType) { if (!$contentType || $contentType == self::CONTENT_TYPE) { return array(); } } } ?>