Why does Joomla class loader not work on Phalanger

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

Why does Joomla class loader not work on Phalanger

Postby highcore » February 4th, 2015, 6:57 am

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.
highcore
 
Posts: 9
Joined: December 23rd, 2014, 2:14 am

Re: Why does Joomla class loader not work on Phalanger

Postby Jakub Misek » February 4th, 2015, 11:37 pm

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,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2079
Joined: January 4th, 2012, 2:42 pm
Location: Prague

Re: Why does Joomla class loader not work on Phalanger

Postby highcore » February 5th, 2015, 10:43 pm

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
highcore
 
Posts: 9
Joined: December 23rd, 2014, 2:14 am

Re: Why does Joomla class loader not work on Phalanger

Postby Jakub Misek » February 7th, 2015, 10:04 am

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.
Jakub Misek │ DEVSENSE s.r.o. | @misekjakubjakub@devsense.com
User avatar
Jakub Misek
 
Posts: 2079
Joined: January 4th, 2012, 2:42 pm
Location: Prague


Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 2 guests

cron

User Control Panel

Login

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests (based on users active over the past 5 minutes)
Most users ever online was 77 on September 4th, 2018, 9:46 pm

Users browsing this forum: No registered users and 2 guests
Phalanger