cvs: php4 /pear/PEAR Installer.php
| From: | Thomas V.V.Cox | Date: | Tue, 22 May 2001 16:25:05 +0000 |
| Subject: | cvs: php4 /pear/PEAR Installer.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-161@lists.php.net to get a copy of this message | ||
cox Tue May 22 09:25:05 2001 EDT
Modified files:
/php4/pear/PEAR Installer.php
Log:
- added error cheking and abort when no script install dir is set
- minor typos
Index: php4/pear/PEAR/Installer.php
diff -u php4/pear/PEAR/Installer.php:1.11 php4/pear/PEAR/Installer.php:1.12
--- php4/pear/PEAR/Installer.php:1.11 Tue May 15 07:15:09 2001
+++ php4/pear/PEAR/Installer.php Tue May 22 09:25:04 2001
@@ -103,7 +103,7 @@
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 @@
}
xml_parser_free($xp);
-
return true;
}
@@ -393,6 +392,8 @@
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 @@
$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 @@
if (!$d) {
break;
}
- if (!is_dir($d)) {
+ if (!@is_dir($d)) {
$this->mkDirHier($d);
}
$bfile = basename($file);