Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

(no description)

File Size: 86 lines (3 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Mustache_Loader_ProductionFilesystemLoader:: (2 methods):
  __construct()
  loadFile()


Class: Mustache_Loader_ProductionFilesystemLoader  - X-Ref

Mustache Template production filesystem Loader implementation.

A production-ready FilesystemLoader, which doesn't require reading a file if it already exists in the template cache.

{@inheritdoc}
__construct($baseDir, array $options = array()   X-Ref
Mustache production filesystem Loader constructor.

Passing an $options array allows overriding certain Loader options during instantiation:

$options = array(
// The filename extension used for Mustache templates. Defaults to '.mustache'
'extension' => '.ms',
'stat_props' => array('size', 'mtime'),
);

Specifying 'stat_props' overrides the stat properties used to invalidate the template cache. By default, this
uses 'mtime' and 'size', but this can be set to any of the properties supported by stat():

http://php.net/manual/en/function.stat.php

You can also disable filesystem stat entirely:

$options = array('stat_props' => null);

But with great power comes great responsibility. Namely, if you disable stat-based cache invalidation,
YOU MUST CLEAR THE TEMPLATE CACHE YOURSELF when your templates change. Make it part of your build or deploy
process so you don't forget!

param: string $baseDir Base directory containing Mustache template files.
param: array  $options Array of Loader options (default: array())

loadFile($name)   X-Ref
Helper function for loading a Mustache file by name.

param: string $name
return: Mustache_Source Mustache Template source