Page 1 of 1

Why does Joomla class loader not work on Phalanger

PostPosted: February 4th, 2015, 6:57 am
by highcore
Hi.

I've already spent a huge amount of time trying to run Joomla on Phalanger.

I get all sorts of class not found errors. I even tried manually doing require_once on a lot of classes but it's one after the other for the 6000+ files on Joomla. I can't do this manually.

What difference is there between the class loading mechanism in Phalanger versus the original PHP engine?

My Joomla site works perfectly when using normal PHP, but not on Phalanger. How can I make it work? I even tried modifying the Phalanger runtime to load the types from a referenced DLL using AppDomain.CurrentDomain.GetAssemblies(), but the problem is still these aren't properly compiled by the compiler and instead are dynamically compiled as a string.

Do we need to contract consulting services from you? we need to make sure we can get this working *before* buying a Phalanger license. If you can guarantee that it's going to work then we can purchase the license tomorrow. Otherwise I'm afraid I'll have to stick to the inferior solution of putting an iframe in my PHP site and point it to a .Net web app.

Re: Why does Joomla class loader not work on Phalanger

PostPosted: February 4th, 2015, 11:37 pm
by Jakub Misek
Hi,

About the classes being compiled as strings; this is caused by the fact, compiler cannot be sure at compile time what the base class is (base class is defined in another file not being directly included and Phalanger has to handle situations where a file is replaced within already compiled web site, so it has to compile the additional file which would corrupt already compiled class hierarchy ...) Currently it is solved in this way, and compilation itself is postponed to run time.

The autoload mechanism should work in the same way as in PHP. Doing require manually or any modifications to Phalanger Core should not be necessary. Can you add debug write to autoload functions in Joomla to see whether they are called as they are in PHP?

Thanks,

Re: Why does Joomla class loader not work on Phalanger

PostPosted: February 5th, 2015, 10:43 pm
by highcore
Yes. I can confirm that the loader.php code is being executed, see:

viewtopic.php?f=3&t=1420#p6670

Anything else I need to look at? I'm at a loss at the moment.

We have a big project coming up and ideally I'd like to use Joomla as a front end and content management, and C# code to do all the complex business logic and interaction with third parties.

If you can help me to get Joomla running on Phalanger we will right away purchase a license ;)

Thanks

Re: Why does Joomla class loader not work on Phalanger

PostPosted: February 7th, 2015, 10:04 am
by Jakub Misek
I would check what autoload function and when are called using regular PHP and using Phalanger. Because obviously Phalanger does not call an autoload in some case or the autoload does not resolve the file to be included correctly.