/** * Remove session records older than a given expiration. * * @param int $expiration * @return void */ public function sweep($expiration) { foreach ($this->files->files($this->path) as $file) { // If the last modification timestamp is less than the given UNIX expiration // timestamp, it indicates the session has expired and should be removed // off of the disks so we don't use space for files that have expired. if ($this->files->lastModified($file) < $expiration) { $this->files->delete($file); } } }
/** * Determine if the view at the given path is expired. * * @param string $path * @return bool */ public function isExpired($path) { $compiled = $this->getCompiledPath($path); // If the compiled file doesn't exist we will indicate that the view is expired // so that it can be re-compiled. Else, we will verify the last modification // of the views is less than the modification times of the compiled views. if (!$this->cachePath or !$this->files->exists($compiled)) { return true; } $lastModified = $this->files->lastModified($path); return $lastModified >= $this->files->lastModified($compiled); }