Source for file GC.php
Documentation is available at GC.php
* Class for providing garbage collection for any VFS instance.
* $Horde: framework/VFS/lib/VFS/GC.php,v 1.1.2.3 2009/01/06 15:23:47 jan Exp $
* Copyright 2003-2009 The Horde Project (http://www.horde.org/)
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
* @author Michael Slusarz <slusarz@horde.org>
* Garbage collect files in the VFS storage system.
* @param VFS &$vfs The VFS object to perform garbage collection on.
* @param string $path The VFS path to clean.
* @param integer $secs The minimum amount of time (in seconds) required
* before a file is removed.
function gc(&$vfs, $path, $secs = 345600 )
/* A 1% chance we will run garbage collection during a call. */
/* Use a backend-specific method if one exists. */
return $vfs->gc ($path, $secs);
/* Make sure cleaning is done recursively. */
$files = $vfs->listFolder ($path, null , true , false , true );
$modtime = time() - $secs;
foreach ($files as $val) {
if ($val['date'] < $modtime) {
$vfs->deleteFile ($path, $val['name']);
Documentation generated on Mon, 11 Mar 2019 15:34:54 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|