URLs
Temp Files
Horde Registry


Working with temporary files


<?php

// Find the system temporary directory
$dir Horde::getTempDir();

// Get a temporary filename, and register it to be deleted
$file Horde::getTempFile('foo');

?>
  

  • Horde::getTempDir() looks for upload_tmp_dir or TMPDIR, then tries common locations
  • Filenames generated by Horde::getTempFile() will be deleted at the end of the request
  • You can also use the _fileCleanup() function to register other files to be cleaned up