waneck / testrepo

0 stars 0 forks source link

Issue 52 - haXe/PHP Serialize a SPOD object - haxe #52

Closed waneck closed 11 years ago

waneck commented 11 years ago

[Google Issue #52 : http://code.google.com/haxe/issues/detail?id=52] by filt3...@gmail.com, at 2010-02-01T15:10:40.000Z I have a User class that extends php.db.Object All works fine until I try to use haxe.Serializer.run( myUser ); It throws : Fatal error: Access to undeclared static property: User::$tname in dev\lib\php\Boot.class.php(278) : eval()'d code on line 1

class Test { static function main() { var cnx = php.db.Mysql.connect( { user : "root", socket : null, port : 3306, pass : "", host : "localhost", database : "fk" } ); php.db.Manager.cnx = cnx; php.db.Manager.initialize();

var ul = User.manager.search( { name : "test", pass : "pass" } );
trace( ul.first() ); // OK
var sUser = haxe.Serializer.run( ul ); // FATAL ERROR

} }

waneck commented 11 years ago

[comment from franco.p...@gmail.com, published at 2010-02-01T15:20:01.000Z]

waneck commented 11 years ago

[comment from ncanna...@gmail.com, published at 2010-02-13T17:17:26.000Z] Please note that there is guaranty of compatibility of SPOD objects between platforms. Also, since they are quite specific objects, there shouldn't be any guaranty of them being serializable as well.

I'll let Franco decide to fix this one or not ;)

waneck commented 11 years ago

[comment from franco.p...@gmail.com, published at 2010-07-24T14:54:41.000Z] SPOD implementation on PHP tries to mimic as much as possible the Neko behavior but since a lot of Neko magic is used the port is not 100% guaranteed.