3 namespace dokuwiki\Cache
;
6 * Caching of parser instructions
8 class CacheInstructions
extends \dokuwiki\Cache\CacheParser
12 * @param string $id page id
13 * @param string $file source file for cache
15 public function __construct($id, $file)
17 parent
::__construct($id, $file, 'i');
21 * retrieve the cached data
23 * @param bool $clean true to clean line endings, false to leave line endings alone
24 * @return array cache contents
26 public function retrieveCache($clean = true)
28 $contents = io_readFile($this->cache
, false);
29 return !empty($contents) ?
unserialize($contents) : array();
35 * @param array $instructions the instruction to be cached
36 * @return bool true on success, false otherwise
38 public function storeCache($instructions)
40 if ($this->_nocache
) {
44 return io_saveFile($this->cache
, serialize($instructions));