Convert existing code or new joomla 4.[

660 views
Skip to first unread message

Fros...@koonsoft.dk

unread,
Jan 20, 2018, 5:38:40 AM1/20/18
to Joomla! CMS Development
 First, sorry English is not my first language, hope you will read what I'm trying to write.

Around the code and in the "Pool requests" you can read some information.
It is a great job to gather this up.
If you want to contribute, it's hard to get started.

Proposals:
You can combine a form of FAQ that means that you can participate without having to read all [4.0] changes.
This can have a very big impact on how version 4 is received now and then.
https://docs.joomla.org/Portal:Developers could be a place to place this information.

It is clear that joomla version 4 is a conversion of existing code.
We all want to reuse code. Right now, the limited amount of new code is written to version 4.
Right now there are many programmers working on converting code or writing new ones.


Convert existing code to joomla 4.

In order to be able to follow any corrections in the code, in a source control system, one would like to limit changes.
Some classes and methods change names, but are mapped in classmap.php

Question: Should you or should you not correct the code so that it follows the new names?


Question: New code to joomla 4

Question: Should you or should you not follows the new names?

However, in order to do that, I have some questions.

Question on "namespace":
When a component must have its own namespace, for example: namespace Joomla\Component\Associations\...

Where my namespace as extensens developer then should be:
namespace Exampel\Component\..
namespace Exampel\module\..
namespace Exampel\plugin\..
namespace Exampel\templates\.. ?
namespace Exampel\libraries\.. Exampel\library\.. ?
Of course, Exampel has to be replaced with my own.

Are there more "namespace" that extensens development should relate to in their own code.
As extensens developer we need guidance.


Question: with or without "\" in JLog (even change JLog with other APIs)?
In administrator\components\com_admin\Model\SysinfoModel.php "class ContentHelper extends\JHelperContent" used \JLog::add(
In administrator\components\com_admin\helpers\html\phpsetting.php "abstract class JHtmlPhpSetting" is used JLog::add

Question: With or without "use namespace" on the APIs used?
In administrator\components\com_finder\Controller\IndexerController.php "class IndexerController extends BaseController" uses "use Joomla\CMS\Factory;" and $app = Factory::getApplication();
In administrator\components\com_admin\Model\HelpModel.php "HelpModel extends BaseDatabaseModel" used without "use Joomla\CMS\Factory;" and \JFactory::getApplication()->

Questions: With or without "J" in API name?
In templates\cassiopeia\offline.php is used with "use Joomla\CMS\Language\Text;" and Text::_(
In administrator\components\com_content\Helper\ContentHelper.php is used without "use Joomla\CMS\Language\Text;" and \JText::_(


These questions also deal with many similar classes and methods

There are probably more questions that I have overlooked right now. Please help with some guidance.

Yours sincerely
Karsten

Anibal

unread,
Jan 21, 2018, 4:18:16 AM1/21/18
to Joomla! CMS Development
Hi Karsten,

Great idea! A Joomla 4 Development FAQ / Migration Guide could be a great addition to the current documentation.

You can start adding the page in docs.joomla.org, and the docs team will continue on your collaboration to improve it and add it to the index page. The documentation is in Wiki format (don't worry much about that).


Regards,
Reply all
Reply to author
Forward
0 new messages