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.
   1  <?php
   2  
   3  /*
   4   * This file is part of Mustache.php.
   5   *
   6   * (c) 2010-2017 Justin Hileman
   7   *
   8   * For the full copyright and license information, please view the LICENSE
   9   * file that was distributed with this source code.
  10   */
  11  
  12  /**
  13   * Mustache Cache in-memory implementation.
  14   *
  15   * The in-memory cache is used for uncached lambda section templates. It's also useful during development, but is not
  16   * recommended for production use.
  17   */
  18  class Mustache_Cache_NoopCache extends Mustache_Cache_AbstractCache
  19  {
  20      /**
  21       * Loads nothing. Move along.
  22       *
  23       * @param string $key
  24       *
  25       * @return bool
  26       */
  27      public function load($key)
  28      {
  29          return false;
  30      }
  31  
  32      /**
  33       * Loads the compiled Mustache Template class without caching.
  34       *
  35       * @param string $key
  36       * @param string $value
  37       */
  38      public function cache($key, $value)
  39      {
  40          $this->log(
  41              Mustache_Logger::WARNING,
  42              'Template cache disabled, evaluating "{className}" class at runtime',
  43              array('className' => $key)
  44          );
  45          eval('?>' . $value);
  46      }
  47  }