E
E
Evgeny Nikolaev2019-12-29 12:08:20
Joomla
Evgeny Nikolaev, 2019-12-29 12:08:20

How is loading cms(framework) Joomla 3.9 step by step? What SQL queries and in what sequence are executed and after loading what files?

There is a task to implement multi-site on Joomla 3.9 (namely, to make subdomains display different content by menu items and to be controlled, if possible, from one admin panel). I briefly got acquainted with the components and plug-ins that are offered in the body, as well as with the approach of deploying one file CMS and linking it to several databases (by the number of sites), the question is not actually about multi-site. There is time and perhaps I will write my own decision on the topic, for this I would like to understand in more detail how the CMS loading is arranged. I have already seen that the described task can be implemented by writing a system plugin, while I see that it is not very convenient for them (although maybe I just did not understand how) to change the menu model (for example, the /libraries/src/Menu/MenuItem.php file), because the question of updating arises. One option is, for example, to place your own copy of MenuItem.php and SiteMenu.php along with the plugin and then connect them with the plugin via require_once before the CMS loads them. In this case, I checked that the autoloader will not touch the source files, which will make it possible to rewrite the files at its own discretion, for example, add the necessary fields to MenuItem.php and rewrite the load method in SiteMenu.php, which contains an SQL query to the table with menu and entering conditions for site bindings prevent Joomla CMS from receiving menu items that are not related to the subdomain. But there is such a moment, if the CMS updates the MenuItem.php and SiteMenu.php files, with this option, those that come with the plugin will still be used, which may mean that the update will not lead to the appearance of new methods and fields (if any).
Please write if there are any normal articles about the process of loading CMS Joomla version 3.9. First of all, I am interested in what files are loaded, from where and what SQL queries are executed, what they return and the description of the files, what happens there in general. I am looking for information in order to understand in more detail the process of loading CMS Joomla 3.9, in order to determine how it is better to add new fields to the menu model and change the SQL query, in particular, to implement multi-site, that is, in particular, to understand whether the option with the system plugin is optimal.
If you have any ideas or experience in implementing multisite on Joomla - also unsubscribe .
Or maybe in Joomla 3.9 there is some standard way to debug, which will help you understand exactly how the CMS is loaded, what happens and at what stages in Joomla.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
Flying, 2019-12-29
@Flying

Nothing will give you as much knowledge about the structure and operation of the code as thoughtfully walking through it with a debugger.
So just take the same PHPStorm, set up debugging through XDebug there and spend a day walking through the code, going through from the very beginning. As a result, you will begin to better understand the code you are working with, and this will be your own, direct knowledge, and not knowledge gleaned from external sources.

E
Evgeny Nikolaev, 2019-12-29
@nikolaevevge

So what files are loaded at what point, I found SQL too. I published this info here - blog.ivru.net/?id=170 if someone needs it.
Thanks for the Joomla Debug Console, I didn't know there was such a thing. At least until the 3rd version of Joomla, it was not less informative (or I did not understand then).
It will be necessary later to publish screenshots where it turns on.
I'll wait, maybe someone else will write something on the topic, until I mark the solution.
Installing PHP Xdebuger on a virtual dedicated server in CentOs 7 x64 (the repository was previously configured for PHP 7.2, more details here blog.ivru.net/?id=156 )
The line that Joomla asks for in the php.ini file in order to show file addresses in profiling (and not just the class call stack). I've placed it right at the top of the php.ini file, it doesn't mean that you should place it the same way.
Later, as there will be time, I'll throw in screenshots of enabling debugging in Joomla

S
Sergey Korenevsky, 2020-11-13
@Dier_Sergio_Great

Enable "System Debugging" mode in the admin settings.
After that, a panel will appear on the page in which you will find the exact answers to your vague questions. :)
. 5faea02161c14075609659.png
-------------------------------------------------- --------------------
5faea1ada570d831506941.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question