Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

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

Defines 1 class

Mustache_Cache_FilesystemCache:: (6 methods):
  __construct()
  load()
  cache()
  getCacheFilename()
  buildDirectoryForFilename()
  writeFile()


Class: Mustache_Cache_FilesystemCache  - X-Ref

Mustache Cache filesystem implementation.

A FilesystemCache instance caches Mustache Template classes from the filesystem by name:

$cache = new Mustache_Cache_FilesystemCache(dirname(__FILE__).'/cache');
$cache->cache($className, $compiledSource);

The FilesystemCache benefits from any opcode caching that may be setup in your environment. So do that, k?
__construct($baseDir, $fileMode = null)   X-Ref
Filesystem cache constructor.

param: string $baseDir  Directory for compiled templates
param: int    $fileMode Override default permissions for cache files. Defaults to using the system-defined umask

load($key)   X-Ref
Load the class from cache using `require_once`.

param: string $key
return: bool

cache($key, $value)   X-Ref
Cache and load the compiled class.

param: string $key
param: string $value

getCacheFilename($name)   X-Ref
Build the cache filename.
Subclasses should override for custom cache directory structures.

param: string $name
return: string

buildDirectoryForFilename($fileName)   X-Ref
Create cache directory.

param: string $fileName
return: string

writeFile($fileName, $value)   X-Ref
Write cache file.

param: string $fileName
param: string $value