Mapping PHP and Flex Objects

I am using ZendAMF for remote access.

<?php
    error_reporting(E_ALL | E_STRICT); //error reporting, not needed

    require_once "Zend/Amf/Server.php"; //the zendAMF server
    require_once "process.php";  //our test class

    $server = new Zend_Amf_Server(); //declare the server

    $server->setClass("process"); //load our test-class to the server
    $server->setClassMap("Session", "Session");
    echo($server->handle()); // needed to start the server
?>

My question is: I have an ActionScript class session and a PHP class session, but it is not displayed yet. I have some doubts ... maybe stupid ...

If the file name of the PHP class must be the same name as the class name, since it is not necessary, but when displayed it carries an estimate of the cost.

As you will call these mapped objects inside your flex application. My approach is listed below, but not sure if it is correct or not.

$ server-> setClassMap ("Session", "Session"); This is the PHP and Flex class in the above function.

Also my PHP session class is inside the include directory, I must indicate that somewhere or ZendAMf will take care of this.

Flex code.

var userSession:Session = new Session();
sessionHold.text = userSession.userid; 

Thanks.

+3
2

, . -

[RemoteClass ( = "" )]

AS Zend_Amf, getASClassName() PHP. ( Zend_Amf) screencast re: class mapping. , .

http://www.wadearnold.com/tutorials/zend/classmap/

+4

TypeOneError ;

[RemoteClass(alias="Session")]
[Bindable]

ActionScript.

, , :

  • ActionScript
0

Source: https://habr.com/ru/post/1711079/


All Articles