Where should the php files be placed?

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

Where should the php files be placed?

Postby owengerig » October 16th, 2012, 2:55 pm

I have my question posted on SO as well which has a few images to show how my project is setup and the errors Im getting (http://stackoverflow.com/questions/1290 ... hp-classes). However my question should be generic enough to not necessarily need that stuff.

Im following the latest tutorial ".NET interoperability overview of Phalanger 3.0" at http://www.php-compiler.net/blog/2012/n ... langer-3-0

But
dynamic x = globals.@class.<CLASSNAME>(args);
does not find my php classes.
I have tried with my own php classes as well as the default.php which comes with the sample located at the link above.

Where should the php files be put, and are there any addition settings in VB that need to be set?
owengerig
 
Posts: 10
Joined: October 16th, 2012, 2:50 pm

Re: Where should the php files be placed?

Postby Jakub Misek » October 16th, 2012, 4:46 pm

You have to include your php files into the PHP context first ...

In Web App, to 'simulate' php lifecycle properly, do following:
Code: Select all
using (var request_context = RequestContext.Initialize(ApplicationContext.Default, HttpContext.Current))
{
    var context = request_context.ScriptContext;
    context.Include("default.php", false);
// now the declarations declared by default.php are available in context.
// do anything with PHP objects here
}
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: Where should the php files be placed?

Postby owengerig » October 16th, 2012, 4:54 pm

Thanks again for the help. This did work
owengerig
 
Posts: 10
Joined: October 16th, 2012, 2:50 pm

Re: Where should the php files be placed?

Postby Jakub Misek » October 16th, 2012, 5:00 pm

No problem. Keep asking :-)
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2092
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 12 guests

cron

User Control Panel

Login

Who is online

In total there are 12 users online :: 0 registered, 0 hidden and 12 guests (based on users active over the past 5 minutes)
Most users ever online was 297 on March 29th, 2024, 7:06 am

Users browsing this forum: No registered users and 12 guests