-function make_tar($dirname, $files, $extra = '') {
- $tmpdir = '/tmp/make_tar';
+function make_tar($dirname, $files, $pre_archive_func = false, $tmpdir = false) {
+ if(!$tmpdir) {
+ if($GLOBALS['wfpl_tmpdir']) {
+ $tmpdir = $GLOBALS['wfpl_tmpdir'];
+ } else {
+ $tmpdir = 'tmp';
+ }
+ }
+
+ # user is choosing a very non-unique directory name, so make a random one to put it in
+ $tmpdir .= '/' . sprintf('%08x%08x', mt_rand(), mt_rand());
+ mkdir($tmpdir);
+