/** * Garbage collect files in the VFS storage system. * * @param string $path The VFS path to clean. * @param integer $secs The minimum amount of time (in seconds) required * before a file is removed. * * @throws Horde_Vfs_Exception */ public function gc($path, $secs = 345600) { $path = $this->_convertPath($path); list($op, $values) = $this->_nullString($path); $sql = sprintf('DELETE FROM %s WHERE vfs_type = ? AND vfs_modified < ? AND (vfs_path %s OR vfs_path LIKE ?)', $this->_params['table'], $op); $values = array_merge(array(self::FILE, time() - $secs), $values, array($path . '/%')); try { $this->_db->delete($sql, $values); } catch (Horde_Db_Exception $e) { throw new Horde_Vfs_Exception($e); } }
/** * Deletes a virtual email. * * @param integer $virtual_id The id of the virtual email to delete. */ public function deleteVirtual($virtual_id) { $sql = 'DELETE FROM ' . $this->_params['tables']['virtuals'] . ' WHERE ' . $this->_getTableField('virtuals', 'virtual_id') . ' = ?'; $this->_db->delete($sql, array($virtual_id)); }