1<?php 2 3namespace dokuwiki\template\twigstarter; 4 5use Twig\Loader\FilesystemLoader; 6 7/** 8 * Custom loader that takes the DokuWiki config into account 9 */ 10class TwigStarterLoader extends FilesystemLoader 11{ 12 /** 13 * Cache is dependent on DokuWiki config 14 * @inheritdoc 15 */ 16 public function isFresh($name, $time) 17 { 18 $fresh = parent::isFresh($name, $time); 19 if (!$fresh) return $fresh; 20 21 $ctime = @filemtime(DOKU_CONF . 'local.php'); 22 23 return ($time > $ctime); 24 } 25} 26