Caching Issue with Standard mode?
Posted: February 21st, 2013, 12:07 am
Hey folks - I'm testing using Phalanger in a C# application as a scripting language. The short of it is that I want to call standard PHP code from within C# and retrieve the value. Simple enough.
Here's the issue: I created a simple Windows Forms application and added all the relevant references. I created a simple PHP class file as follows:
And in my Forms application, I create the context and call the PHP code:
Compile and run in debug and it works just fine. I get the message box and it return "Test1" as expected.
Now for grins, I change the return statement to: return "something else";
Compile and run again and it still returns "Test1". Step through it in debug mode and I can see the PHP code is indeed updated. This is unexpected. As a test, I changed the function name in the PHP code to something else and the C# code doesn't error and still return "Test1". Obviously Phalanger is caching the PHP code somewhere, but I've been unable to find it.
I've run the "Clean and Rebuild" option on the entire solution as well as the individual project. I've manually deleted all the bin\debug files. I created a new project and follow the same steps... all yields the same results.
This is the most recent version (as of yesterday) of Phalanger running on VS2010 Professional (also up to date with SP's, etc), Windows 7 x64 (also up to date).
Is anyone aware of any additional caching Phalanger is doing when calling PHP code in "standard" mode? If so, any idea how I can clear that cache to get the expected results?
Here's the issue: I created a simple Windows Forms application and added all the relevant references. I created a simple PHP class file as follows:
- Code: Select all
<?php
class Standard
{
function __construct()
{
}
function wows()
{
return "Test1";
}
}
?>
And in my Forms application, I create the context and call the PHP code:
- Code: Select all
private void button1_Click(object sender, EventArgs e)
{
ScriptContext context = ScriptContext.CurrentContext;
context.Include("standard.php", true);
var c = (PhpObject)context.NewObject("Standard", PhpArray.Keyed());
var bar2 = new PhpCallback(c, "wows");
var ret3 = bar2.Invoke(null, new object[] {});
MessageBox.Show((string)ret3);
}
Compile and run in debug and it works just fine. I get the message box and it return "Test1" as expected.
Now for grins, I change the return statement to: return "something else";
Compile and run again and it still returns "Test1". Step through it in debug mode and I can see the PHP code is indeed updated. This is unexpected. As a test, I changed the function name in the PHP code to something else and the C# code doesn't error and still return "Test1". Obviously Phalanger is caching the PHP code somewhere, but I've been unable to find it.
I've run the "Clean and Rebuild" option on the entire solution as well as the individual project. I've manually deleted all the bin\debug files. I created a new project and follow the same steps... all yields the same results.
This is the most recent version (as of yesterday) of Phalanger running on VS2010 Professional (also up to date with SP's, etc), Windows 7 x64 (also up to date).
Is anyone aware of any additional caching Phalanger is doing when calling PHP code in "standard" mode? If so, any idea how I can clear that cache to get the expected results?