cvs: php4 /pear/PEAR Installer.php

From: Date: Wed, 01 Aug 2001 13:24:55 +0000
Subject: cvs: php4 /pear/PEAR Installer.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-398@lists.php.net to get a copy of this message
cox Wed Aug 1 09:24:55 2001 EDT Modified files: /php4/pear/PEAR Installer.php Log: added BaseInstall dir support Index: php4/pear/PEAR/Installer.php diff -u php4/pear/PEAR/Installer.php:1.15 php4/pear/PEAR/Installer.php:1.16 --- php4/pear/PEAR/Installer.php:1.15 Thu Jul 19 07:15:48 2001 +++ php4/pear/PEAR/Installer.php Wed Aug 1 09:24:55 2001 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.15 2001/07/19 11:15:48 cox Exp $ +// $Id: Installer.php,v 1.16 2001/08/01 13:24:55 cox Exp $ require_once "PEAR/Common.php"; @@ -192,16 +192,22 @@ } $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 @@ 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)) {

« previous php.pear.cvs (#398) next »