Proble with Eclipse IDE since J3.8

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderator: ooffick

Forum rules
Locked
roland_d_alsace
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Nov 07, 2013 8:53 am

Proble with Eclipse IDE since J3.8

Post by roland_d_alsace » Sun Sep 24, 2017 8:12 pm

Hi.

Since 3.8, my IDE (Eclipse) cannot find the statics class (Jprofiler, JFactory, ...) with the message Jprofiler or Jfactory, ... cannot be resolved to a type.

I think it'a problem with the namespace Joomla\CMS ?

Have you an idea how to solve this ?

Regards.

roland_d_alsace
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Nov 07, 2013 8:53 am

Re: Problem with Eclipse IDE since J3.8 - usage of new classes and namespace

Post by roland_d_alsace » Mon Sep 25, 2017 10:49 am

Hi.

I think we need tu use :

Code: Select all

Joomla\CMS\Factory::getApplication();  
instead of

Code: Select all

JFactory::getApplication();  
since 3.8


Mapor
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Dec 29, 2017 1:29 pm

Re: Proble with Eclipse IDE since J3.8

Post by Mapor » Tue Jan 09, 2018 2:12 pm

I have run into the same problem, and your fix is working. But isn't there a better way to fix this than to change the Joomla core code? Probably something with include paths in Eclipse?

deleted user

Re: Proble with Eclipse IDE since J3.8

Post by deleted user » Tue Jan 09, 2018 3:06 pm

No.

In 3.8 a lot of library level classes were renamed and for B/C reasons the old names had to be proxied and in many cases continue to be used to allow extensions that are overloading core classes to continue to hack the API in this way. The old class names just do not exist in the project space anymore except for in a file that registers the old class names to PHP's autoloader at runtime. You might be able to write a plugin for various IDEs that can parse the libraries/classmap.php file, otherwise your best option is to use one of the two tools in the linked issue to generate a set of "stubs" that will fix most IDE autocomplete issues.


Locked

Return to “Joomla! 3.x Coding”