/** * Constructs and initialises a new trait manifest, either loading the data * from the cache or re-scanning for traits. * * @param string $base The manifest base path. * @param bool $forceRegen Force the manifest to be regenerated. */ public function __construct($base, $forceRegen = false) { parent::__construct($base, false, $forceRegen, true); $cacheClass = defined('SS_MANIFESTCACHE') ? SS_MANIFESTCACHE : 'ManifestCache_File'; $this->cache = new $cacheClass('traitmanifest'); $this->cacheKey = 'traits'; if (!$forceRegen && ($data = $this->cache->load($this->cacheKey))) { $this->traits = $data['traits']; } else { $this->regenerateTrait(true); } }