From a50c40cc24554ff23e63703aeccc692c77bb5987 Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Thu, 28 Mar 2002 23:44:31 +0000 Subject: [PATCH] * accept optional tmpdir arg in mkTempDir * handle changelog releases without filelist --- pear/PEAR/Common.php | 52 ++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php index 7a594e414b..dfa081c5a1 100644 --- a/pear/PEAR/Common.php +++ b/pear/PEAR/Common.php @@ -169,13 +169,22 @@ class PEAR_Common extends PEAR /** * Create and register a temporary directory. * + * @param string (optional) Directory to use as tmpdir. Will use + * system defaults (for example /tmp or c:\windows\temp) if not + * specified + * * @return string name of created directory * * @access public */ - function mkTempDir() + function mkTempDir($tmpdir = '') { - if (!$tmpdir = System::mktemp('-d pear')) { + if ($tmpdir) { + $topt = "-t $tmpdir "; + } else { + $topt = ''; + } + if (!$tmpdir = System::mktemp($topt . '-d pear')) { return false; } $this->addTempFile($tmpdir); @@ -662,7 +671,6 @@ class PEAR_Common extends PEAR if (@sizeof($pkginfo['changelog']) > 0) { $ret .= " \n"; foreach ($pkginfo['changelog'] as $oldrelease) { - var_dump($oldrelease); $ret .= $this->_makeReleaseXml($oldrelease, true); } $ret .= " \n"; @@ -718,29 +726,27 @@ class PEAR_Common extends PEAR } $ret .= "$indent \n"; } - $ret .= "$indent \n"; -/* - ob_start(); - var_dump($pkginfo['filelist']); - $tmp = ob_get_contents(); - ob_end_clean(); - $ret .= $tmp; -*/ - foreach ($pkginfo['filelist'] as $file => $fa) { - if ($fa['role'] == 'extsrc') { - $ret .= "$indent \n"; - $ret .= "$indent $file\n"; - $ret .= "$indent $fa[sources]\n"; - $ret .= "$indent \n"; - } else { - $ret .= "$indent $fa) { + if ($fa['role'] == 'extsrc') { + $ret .= "$indent \n"; + $ret .= "$indent $file\n"; + $ret .= "$indent $fa[sources]\n"; + $ret .= "$indent \n"; + } else { + $ret .= "$indent