ClaySharp objects from PHP

Discussion about the open-source Phalanger [?] project.

ClaySharp objects from PHP

Postby Piedone » October 16th, 2012, 10:01 am

Hi,

another question, maybe about an edge case now. I'd like to use ClaySharp (http://clay.codeplex.com/) objects in a PHP script. Here's also a bit of in-depth explanation what Clay is and how it works: http://downplay.co.uk/tutorials/clay/down-the-rabbit-hole. Long story short, as far as I understand, Clay objects are dynamic objects that also have dynamic "behaviour", that means, you can also call methods on them that really don't exist; however, there is an intercepting logic that handles the method call. So it works and is very nice, but in the end you're accessing methods and properties that the object in reality doesn't have.
Now this technique makes it problematic to use in PHP scripts. I fed the script a Clay object but from PHP only the real properties and methods of the object is usable, not the dynamic ones. (When I try to call dynamic members I get a notice telling e.g. undefined property.)
Could you help me here how to handle this scenario? Is there a way to tell Phalanger that these are really, really dynamic objects?

Thanks in advance!
Piedone
 
Posts: 11
Joined: October 12th, 2012, 7:30 pm

Re: ClaySharp objects from PHP

Postby Jakub Misek » October 16th, 2012, 1:20 pm

Hi,

Thanks for the info.

Phalanger uses dynamic in PHP -> .NET interoperability (so you can call PHP objects thru dynamic in C#).

However the second way is not supported yet, so call to dynamic methods/properties are not handled. This would require 5 days work.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: ClaySharp objects from PHP

Postby Piedone » October 16th, 2012, 9:44 pm

Hi,

I see, thank you. This is unfortunate, but I see.
Actually what we with a friend of mine have done in the past days, and also the reason I asked you a bunch of questions, is a general scripting engine with PHP support for the .NET Orchard CMS, published today: http://english.orchardproject.hu/blog/php-scripting-for-orchard
So thank you and the other developers for the great work on Phalanger!
Piedone
 
Posts: 11
Joined: October 12th, 2012, 7:30 pm


Return to Phalanger project

Who is online

Users browsing this forum: Bing [Bot] and 20 guests

cron

User Control Panel

Login

Who is online

In total there are 21 users online :: 1 registered, 0 hidden and 20 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: Bing [Bot] and 20 guests