From: Stig Bakken Date: Thu, 28 Mar 2002 23:44:31 +0000 (+0000) Subject: * accept optional tmpdir arg in mkTempDir X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~991 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a50c40cc24554ff23e63703aeccc692c77bb5987;p=php * accept optional tmpdir arg in mkTempDir * handle changelog releases without filelist --- 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