Use Classes and Sessions from PHP code / files in ASP.Net

Extending PHP application with ASP.NET. Configuring ASP.NET to run Phalanger powered PHP code properly and efficiently.

Use Classes and Sessions from PHP code / files in ASP.Net

Postby compucoder » December 14th, 2012, 1:14 am

I have my PHP application running 100% under Phalanger and now want to start extending it with C# and .aspx pages.

I figured out how to access the Session variables in .aspx pages just by using the Session[] array. This is simple when the content is a basic type. I cannot figure out how to get at the properties and methods if the session var is an object. Can someone provide an example on how to do this?

Also, is there a way to use the PHP classes from the PHP files in aspx pages? Basically, instantiate a C# object for a Class defined in a .php page.

Our goal is to slowly migrate our native PHP products over to C#/ASP.Net and would like to use Phalanger to help with this. The 2 issues above will solve most of our difficulties.

Thanks.
compucoder
 
Posts: 12
Joined: August 16th, 2012, 12:29 pm

Re: Use Classes and Sessions from PHP code / files in ASP.Ne

Postby Jakub Misek » December 14th, 2012, 4:02 pm

Yes, this is all possible very easily.

Methods of PHP objects can be called using 'dynamic' keyword (.NET 4.0). Instantiating PHP classes too.

See http://www.php-compiler.net/blog/2012/n ... langer-3-0 for details.

Thanks
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2085
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to PHP/ASP.NET Web Applications

Who is online

Users browsing this forum: No registered users and 1 guest

cron

User Control Panel

Login

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 89 on October 15th, 2018, 4:06 pm

Users browsing this forum: No registered users and 1 guest
Phalanger