[dev] Crushing temp file generation in Turba Objects

Michael M Slusarz slusarz at horde.org
Sat Oct 29 07:47:12 UTC 2011


Quoting Michael J Rubinsky <mrubinsk at horde.org>:

> I've also added new functionality to Horde::getTmpFile that allows a  
> file to be registered for removal at session end, instead of at  
> request shutdown. This will probably only work when the user  
> actually logs out, but it's better than nothing at this point. There  
> seems to be no reliable way of persisting a file for only the  
> session, while ensuring it is gc'd without any administrator action  
> AND without the possibility of killing an active session's files (as  
> would be the case if we ran a timed script to gc the files).

This is all correct.  I'm doing a similar thing to clean up IMP  
attachment data when a user logs out.

I altered your addition a bit.  First, this is not the kind of thing  
we should be using session object storage for.  Session object storage  
is instead a hackish solution for UI things that can't really be done  
any other way.  Quite honestly, the things using session object  
storage should theoretically be able to be refactored to not use it,  
although that refactoring might admittedly be difficult.

Also, these files should not be cleaned up within the Session library.  
  The session library is meant to be data independent - it doesn't  
care WHAT is being stored in it.  It only handles the mechanics of  
storing the data.  This kind of garbage collection is instead more  
properly done within an application's logout() method (e.g.  
Horde_Application#logout()).  You can see IMP for other examples of  
logout tasks.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the dev mailing list