• A valid XenForo Licence validation token will be required to complete signup and purchasing.
    This may retrieve this from the XenForo Customer Area.
  • All XenForo 2.3+ add-ons require at least php 8.0, recommend php 8.2+
    All XenForo 2.2+ add-ons require at least php 7.2, recommend php 8.x
    All XenForo 2.0-2.1 add-ons require at least php 5.6, recommend php 7.x.
    The Standard Library add-on is also required.
    Older php versions are not supported, and add-ons will either refuse to install or fail to function.
  • Automatic discounts are applied for orders above $100 USD (10%) or for early renewals (5%)

Template Phrase Store

Rewrite template/phrase storage to use less disk/memory

Overview Releases (5)

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.

Installing has post-install steps

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

Uninstalling is disruptive

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

Design notes

  • 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

xf_phrase_compiled table

Purpose: Used when querying for non-grouped phrases.
Addon changes: Disabled and emptied by this add-on.

xf_template_phrase table

Purpose: Tracks phrase usage in templates, and triggers template recompiles if those phrases are changed
Addon changes: Populated, but no longer triggers template recompiles

xf_language.phrase_cache column

Purpose: Tracks phrase usage in templates, and triggers template recompiles if those phrases are changed
Addon changes: Disabled and emptied by this add-on.

xf_language.global_cache column

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.

\XF\Language class

Rework caching logic as there is no need to store copies of the phrase text, as php opcache can intern the entire phrase data

Template watcher

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;

Product Information

XenForo 2.2+ php 8.0+
Seller
Atelier Aphelion
Release date
Last update
Customer rating
0.00 star(s) 0 ratings

Pricing information

12 Months
$60.00
Renewal cost
$45.00

Share this product

Back
Top