From: Tomas V.V.Cox Date: Wed, 1 Aug 2001 13:24:55 +0000 (+0000) Subject: added BaseInstall dir support X-Git-Tag: PRE_ENGINE2_SPLIT~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=88748bc7a82d9b2890184f5d0c31a5a4ec97aedf;p=php added BaseInstall dir support --- diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 4f9f5dd2d1..a4c595691a 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -192,16 +192,22 @@ class PEAR_Installer extends PEAR_Common } $tmp_path = dirname($descfile); foreach ($pkginfo['filelist'] as $fname => $atts) { - $dest_dir = $this->phpdir . DIRECTORY_SEPARATOR . dirname($fname); + $dest_dir = $this->phpdir . DIRECTORY_SEPARATOR; + if (isset($atts['BaseInstallDir'])) { + $dest_dir .= $atts['BaseInstallDir'] . DIRECTORY_SEPARATOR; + } + if (dirname($fname) != '.') { + $dest_dir .= dirname($fname) . DIRECTORY_SEPARATOR; + } $fname = $tmp_path . DIRECTORY_SEPARATOR . $fname; - $this->_copyFile($fname, $dest_dir, $atts); + $this->_installFile($fname, $dest_dir, $atts); } return true; } - function _copyFile($file, $dest_dir, $atts) + function _installFile($file, $dest_dir, $atts) { - $type = strtolower($atts["Role"]); + $type = strtolower($atts['Role']); switch ($type) { case "test": // don't install test files for now @@ -211,7 +217,7 @@ class PEAR_Installer extends PEAR_Common case 'doc': case 'php': default: - $dest_file = $dest_dir . DIRECTORY_SEPARATOR . basename($file); + $dest_file = $dest_dir . basename($file); break; } if (!@is_dir($dest_dir)) {