From 370f099492692b9a6b48d35d33a1a3122e4e83aa Mon Sep 17 00:00:00 2001 From: "Tomas V.V.Cox" Date: Tue, 22 May 2001 16:25:04 +0000 Subject: [PATCH] - added error cheking and abort when no script install dir is set - minor typos --- pear/PEAR/Installer.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php index 363141d359..5a650a4ba3 100644 --- a/pear/PEAR/Installer.php +++ b/pear/PEAR/Installer.php @@ -103,7 +103,7 @@ class PEAR_Installer extends PEAR_Common function mkDirHier($dir) { $dirstack = array(); - while (!is_dir($dir) && $dir != DIRECTORY_SEPARATOR) { + while (!@is_dir($dir) && $dir != DIRECTORY_SEPARATOR) { array_unshift($dirstack, $dir); $dir = dirname($dir); } @@ -343,7 +343,6 @@ class PEAR_Installer extends PEAR_Common } xml_parser_free($xp); - return true; } @@ -393,6 +392,8 @@ class PEAR_Installer extends PEAR_Common break; case "Dir": if (!$this->phpdir) { + return $this->raiseError("No script destination directory found\n", + null, PEAR_ERROR_DIE); break; } $type = $this->current_attributes["Type"]; @@ -404,21 +405,11 @@ class PEAR_Installer extends PEAR_Common $this->destdir = $dir; } break; - /* XXXXX Remove me! - if (is_file($d)) { - return $this->raiseError("mkdir $d failed: is a file"); - } - if (is_dir($d)) { - break; - } - if (!mkdir($d, 0755)) { - return $this->raiseError("mkdir $d failed"); - break; - } - $this->log(1, "created dir $d"); - break;*/ + case "File": if (!$this->phpdir) { + return $this->raiseError("No script destination directory found\n", + null, PEAR_ERROR_DIE); break; } $type = strtolower($this->current_attributes["Role"]); @@ -440,7 +431,7 @@ class PEAR_Installer extends PEAR_Common if (!$d) { break; } - if (!is_dir($d)) { + if (!@is_dir($d)) { $this->mkDirHier($d); } $bfile = basename($file); -- 2.50.1