It is required that
Installer App Helper add-on is installed, as XenForo upgrades may break the site with this add-on installed.
XenForo writes phrases into templates, this causes language x template files x styles to be written.
As there is always 2 styles and 2 languages, this causes many more template files to be written than expected.
XenForo 2.x introduced "group phrases" which are written to a per-language php file, but did not fully decouple phrases from templates.
This add-on extracts all non-grouped phrases to their own per-language php file, allowing breaking the link between phrases and templates.
This completely removes the need to generate a query for non-grouped phrase, and makes "global phrases" redundant.
To avoid breaking the site while installed, the add-on probes file paths to find a valid template.
Once the add-on is installed this can be disabled via the config.php option:
PHP:
// If this value is not set, or is true, file probes are done which allow loading templates from the stock paths
$config['svProbeTemplateStore'] = false;
Once this is done, the old phrase/template files can be removed via:
Code:
rm -rf internal_data/code_cache/phrase_groups/l*
rm -rf internal_data/code_cache/templates/l*
If template/phrase rebuilding needs to be done this can be done via the CLI commands:
Code:
php cmd.php xf-rebuild:sv-phrases
php cmd.php xf-rebuild:sv-templates
On uninstalling, the path to template changes and XF renders a white page until the installer completes or
php cmd.php xf:rebuild-master-data
is manually run after uninstalling.
Recovery steps:
Code:
rm -rf internal_data/code_cache/phrase_groups
rm -rf internal_data/code_cache/templates
php cmd.php xf:rebuild-master-data
- Using
SV/InstallerAppHelper
:
- The addon runs during XF installer code
- Setting the
xf_addon.is_processing
flag for this add-on is suppressed. As it will send the add-on into a zombie state which will break the site.
- Using web installer is not supported
Purpose: Used when querying for non-grouped phrases.
Addon changes: Disabled and emptied by this add-on.
Purpose: Tracks phrase usage in templates, and triggers template recompiles if those phrases are changed
Addon changes: Populated, but no longer triggers template recompiles
Purpose: Tracks phrase usage in templates, and triggers template recompiles if those phrases are changed
Addon changes: Disabled and emptied by this add-on.
Purpose: Phrases marked as "global" are copied into this value, and are loaded on every request
Addon changes: Disabled and emptied by this add-on.
Rework caching logic as there is no need to store copies of the phrase text, as php opcache can intern the entire phrase data
By default, "template watchers" are disabled when this add-on is active.
In development or design mode, XF has "template watchers" which reload the templates from disk every pageload and compute its has to detect changes.
This only handles templates, and nothing else that would be stored in
_output
, resulting in additional latency for a feature not terribly useful for a 3rd party developer.
To re-enable add to
config.php
:
PHP:
$config['svDisableTemplateWatcher'] = false;