diff options
author | Tomas V.V.Cox <cox@php.net> | 2002-05-14 17:59:41 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2002-05-14 17:59:41 +0000 |
commit | d9f4162ab9d4a946eaea6076e915ccb4df816445 (patch) | |
tree | 4ea346b0e53962832b87bb31691a0e7aaef9fe3f | |
parent | 5ea5758bcfd5191f4e4ba6c7b613305c6d79054e (diff) | |
download | php-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.php | 5 |
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"); |