Only the used frontend plugins language files are loaded, even if the plugin is only used in the backend.
All plugins that have $autoloadLanguage = true;
files are loaded.
Latest staging
None.
Title |
|
Title |
|
I just think plugins used only in the backend shouldnt not autoload the language files.
You'd essentially have to make plugins application specific the same way other extension types are to enforce that. Since these extensions aren't application specific, the only way to enforce it is by adding more class member variables to JPlugin
(which has already caused enough problems because of core previously being updatable as an extension) or making our code start parsing the code of existing plugins for $app->is(Site|Admin)
style checks.
Loading these INI files into memory and parsing them (even with debug mode on) is a rather cheap process, so there isn't really a major performance benefit to be found here anyway. I'd say the effort to do this is more than the gain to be found.
humm .... the performance impact really depends on which php version you use, if you have opcache enabled, the quantity of plugins enabled, the quantity of strings the plugins have, etc.
Anyway i think we can agree that doesn't make much sense this language files being loaded when we know they will not be used in the site client.
Maybe just allowing to set the client in autoloadLanguage
could solve the issue. something like this:
$autoloadLanguage = true; // Autoload in all clients
$autoloadLanguage = false; // Does not autoload
$autoloadLanguage = 0; // Autoload only in site client
$autoloadLanguage = 1; // Autoload only in admin client
Status | New | ⇒ | Discussion |
Labels |
Added:
?
|
I wouldn't do it as allowed integer and boolean values if you're going to touch that var, especially since 0 and 1 are the integer representations of false and true.
The only "true" fix is to not set the var to true and go back to manually loading language files in the plugin event handlers. I still don't personally see any value in trying to add more logic to this stuff since there is such a minimal gain, but if you're that adamant about it go for it.
As you;ve made those PR can this be closed?
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-08-23 09:22:57 |
Closed_By | ⇒ | andrepereiradasilva |
Plugins aren't application specific the same way component, modules, and
templates are. So I wouldn't call this a bug otherwise you're getting into
a very deep hole and I don't think we want to go there.
On Sunday, August 21, 2016, andrepereiradasilva notifications@github.com
wrote: