Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   1  <?php
   2  
   3  namespace Box\Spout\Reader\XLSX\Manager\SharedStringsCaching;
   4  
   5  /**
   6   * Interface CachingStrategyInterface
   7   */
   8  interface CachingStrategyInterface
   9  {
  10      /**
  11       * Adds the given string to the cache.
  12       *
  13       * @param string $sharedString The string to be added to the cache
  14       * @param int $sharedStringIndex Index of the shared string in the sharedStrings.xml file
  15       * @return void
  16       */
  17      public function addStringForIndex($sharedString, $sharedStringIndex);
  18  
  19      /**
  20       * Closes the cache after the last shared string was added.
  21       * This prevents any additional string from being added to the cache.
  22       *
  23       * @return void
  24       */
  25      public function closeCache();
  26  
  27      /**
  28       * Returns the string located at the given index from the cache.
  29       *
  30       * @param int $sharedStringIndex Index of the shared string in the sharedStrings.xml file
  31       * @throws \Box\Spout\Reader\Exception\SharedStringNotFoundException If no shared string found for the given index
  32       * @return string The shared string at the given index
  33       */
  34      public function getStringAtIndex($sharedStringIndex);
  35  
  36      /**
  37       * Destroys the cache, freeing memory and removing any created artifacts
  38       *
  39       * @return void
  40       */
  41      public function clearCache();
  42  }