summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2002-05-14 17:59:41 +0000
committerTomas V.V.Cox <cox@php.net>2002-05-14 17:59:41 +0000
commitd9f4162ab9d4a946eaea6076e915ccb4df816445 (patch)
tree4ea346b0e53962832b87bb31691a0e7aaef9fe3f
parent5ea5758bcfd5191f4e4ba6c7b613305c6d79054e (diff)
downloadphp-git-d9f4162ab9d4a946eaea6076e915ccb4df816445.tar.gz
Try to create the dir where the conf file resides before trying
to write to it
-rw-r--r--pear/PEAR/Config.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/pear/PEAR/Config.php b/pear/PEAR/Config.php
index dcc6b3e1c2..8e3ed6dbd5 100644
--- a/pear/PEAR/Config.php
+++ b/pear/PEAR/Config.php
@@ -341,7 +341,10 @@ when installing packages without a version or state specified',
}
$data = $this->configuration[$layer];
$this->_encodeOutput($data);
- if (@file_exists($file) && !@is_writeable($file)) {
+ if (!@System::mkDir("-p " . dirname($file))) {
+ return $this->raiseError("could not create directory: " . dirname($file));
+ }
+ if (@is_file($file) && !@is_writeable($file)) {
return $this->raiseError("no write access to $file!");
}
$fp = @fopen($file, "w");