Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.

Differences Between: [Versions 402 and 403]

(no description)

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

Defines 1 class

CachingStrategyFactory:: (3 methods):
  __construct()
  createBestCachingStrategy()
  isInMemoryStrategyUsageSafe()


Class: CachingStrategyFactory  - X-Ref


__construct(MemoryLimit $memoryLimit)   X-Ref
No description

createBestCachingStrategy(?int $sharedStringsUniqueCount, string $tempFolder)   X-Ref
Returns the best caching strategy, given the number of unique shared strings
and the amount of memory available.

param: null|int $sharedStringsUniqueCount Number of unique shared strings (NULL if unknown)
param: string   $tempFolder               Temporary folder where the temporary files to store shared strings will be stored
return: CachingStrategyInterface The best caching strategy

isInMemoryStrategyUsageSafe(?int $sharedStringsUniqueCount)   X-Ref
Returns whether it is safe to use in-memory caching, given the number of unique shared strings
and the amount of memory available.

param: null|int $sharedStringsUniqueCount Number of unique shared strings (NULL if unknown)