/** * Clear the next stat result from the cache * * @param string $path If a path is specific, clearstatcache() will be called */ protected function clearStatInfo($path = null) { self::$nextStat = array(); if ($path) { clearstatcache(true, $path); } }
/** * Purges half of the items in the cache, removing the least recently used. */ private static function purgeLru() { usort(self::$statCache, function ($a, $b) { return $a['time'] > $b['time'] ? 1 : ($a['time'] < $b['time'] ? -1 : 0); }); self::$statCache = array_slice(self::$statCache, 0, 500); }