AMFPHP Deserializer and POG classes
The default AMFPHP patterns for including classes defined in your AMF requests do not work for POG classes. The two default patterns that are check for class including by the AMF deserializer are:
[php]
// $mappedClass = SomeObject
$mappedClass . “php” // SomeObject.php
// or
$mappedClass . “.class.php” //SomeObject.class.php
[/php]
For POG classes the pattern is “class.someobject.php”, regardless of the case of the SomeObject class.
Now to added different locations for AMFPHP to look for classes to include for deserialization of AMF requests you open up /amfphp/core/amf/io/AMFBaseDeserializer.php. Go to line 384 (as of AMFPHP 1.9 or the block of code starting with file_exists($GLOBALS['amfphp']['customMappingsPath']) and add the following code for POG classes pattern:
[php]
elseif(file_exists($GLOBALS['amfphp']['customMappingsPath'] . ‘class.’ . strtolower($mappedClass) . ‘.php’))
{
$include = $GLOBALS['amfphp']['customMappingsPath'] . ‘class.’ . strtolower($mappedClass) . ‘.php’;
}
[/php]
Now your AMF request classes passed in method parameters will be deserialized on the PHP to the correct POG class.
Pingback: tutorial: Flex + AMFPHP + POG « explorers’ club