From: Tomas V.V.Cox Date: Mon, 8 Oct 2001 16:52:33 +0000 (+0000) Subject: some clean up X-Git-Tag: PRE_PARAMETER_PARSING_API~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13682462c764f5ff10e9515c96e76f5b345ecfae;p=php some clean up --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 92ebd5323e..f2ec95f729 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -81,10 +81,6 @@ class PEAR_Installer extends PEAR_Common function _PEAR_Installer() { chdir($this->pwd); - if ($this->tmpdir && is_dir($this->tmpdir)) { - System::rm("-rf $this->tmpdir"); - } - $this->tmpdir = null; $this->_PEAR_Common(); } diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php index 61e042087b..16dcd9a0f5 100644 --- a/pear/PEAR/Packager.php +++ b/pear/PEAR/Packager.php @@ -86,17 +86,9 @@ class PEAR_Packager extends PEAR_Common // }}} // {{{ destructor - function _PEAR_Packager() { - $this->_PEAR(); - while (is_array($this->_tempfiles) && - $file = array_shift($this->_tempfiles)) - { - if (is_dir($file)) { - System::rm("-rf $file"); - } else { - unlink($file); - } - } + function _PEAR_Packager() + { + $this->_PEAR_Common(); } // }}} @@ -121,9 +113,11 @@ class PEAR_Packager extends PEAR_Common } $pwd = getcwd(); $pkgfile = basename($pkgfile); - $pkgver = $pkginfo['package'] . '-' . $pkginfo['version']; // don't want strange characters - $pkgver = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkgver); + $pkgname = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkginfo['package']); + $pkgversion = ereg_replace ('[^a-zA-Z0-9._\-]', '_', $pkginfo['version']); + $pkgver = $pkgname . '-' . $pkgversion; + $this->tmpdir = $pwd . DIRECTORY_SEPARATOR . $pkgver; if (file_exists($this->tmpdir)) { return $this->raiseError('Tmpdir: ' . $this->tmpdir .' already exists', @@ -135,7 +129,7 @@ class PEAR_Packager extends PEAR_Common } else { $this->log(2, "+ tmp dir created at: " . $this->tmpdir); } - $this->_tempfiles[] = $this->tmpdir; + $this->addTempFile($this->tmpdir); // Copy files ----------------------------------------------- foreach ($pkginfo['filelist'] as $fname => $atts) {