From: Tomas V.V.Cox Date: Tue, 14 May 2002 17:59:41 +0000 (+0000) Subject: Try to create the dir where the conf file resides before trying X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9f4162ab9d4a946eaea6076e915ccb4df816445;p=php Try to create the dir where the conf file resides before trying to write to it --- 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");