Looking into NameSpacing changes > what are these files for?

26 views
Skip to first unread message

Ruud van Lent

unread,
Nov 30, 2017, 6:01:45 AM11/30/17
to Joomla! General Development
Hi,
looking into changing all of my code to name spaced code, like changing JFactory::getApplication(); to \Joomla\CMS\Factory::getApplication();
The autocomplete of my ide tries to help me (very kind of him/her), but also makes me wonder what the following paths / libraries are for:

1. .\libraries\vendor\joomla
2. .\libraries\legacy
3. .\libraries\src

Can somebody explain?

Allon Moritz

unread,
Nov 30, 2017, 7:52:08 AM11/30/17
to joomla-de...@googlegroups.com
  1. Vendor is from the framework.
  2. Legacy contains deprecated classes which will be removed on some point.
  3. Contains the namespaced classes. And is the root folder for the files in the namespace Joomla\CMS.

--
You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.
To post to this group, send email to joomla-dev-general@googlegroups.com.
Visit this group at https://groups.google.com/group/joomla-dev-general.
For more options, visit https://groups.google.com/d/optout.

Ruud van Lent

unread,
Nov 30, 2017, 9:09:06 AM11/30/17
to Joomla! General Development
Top @laoneo!
Thanks for the info: 3. (.\libraries\src) was introduced in Joomla 3.8? That would mean that using the name spaced classes would break the extension on < 3.8. Is that a correct assumption?

Michael Babker

unread,
Nov 30, 2017, 9:22:46 AM11/30/17
to joomla-de...@googlegroups.com
Namespaced classes are introduced in 3.8.  The global namespace class names are usable through class aliasing until 5.0.  So unless your code is only targeting 3.8+ you don't need to worry about doing a mass change for the moment, but for new projects I'd definitely encourage it.

Allon Moritz

unread,
Nov 30, 2017, 9:27:22 AM11/30/17
to joomla-de...@googlegroups.com
Yes.

Ruud van Lent

unread,
Nov 30, 2017, 9:27:54 AM11/30/17
to Joomla! General Development
I have committed my support to N-1 where N equals the current version (so support for 3.8 (N) and 3.7 (N-1)). So question is: will \Joomla\CMS\Factory::getApplication(); work on Joomla 3.7.x?

Allon Moritz

unread,
Nov 30, 2017, 9:45:22 AM11/30/17
to joomla-de...@googlegroups.com
No.

Ruud van Lent

unread,
Nov 30, 2017, 9:48:17 AM11/30/17
to Joomla! General Development
Top! and thanks for thinking along! So for me currently a 'no go' until 3.9 sees daylight :)


On Thursday, November 30, 2017 at 3:45:22 PM UTC+1, laoneo wrote:
No.

Reply all
Reply to author
Forward
0 new messages