]> granicus.if.org Git - php/commitdiff
Try to create the dir where the conf file resides before trying
authorTomas V.V.Cox <cox@php.net>
Tue, 14 May 2002 17:59:41 +0000 (17:59 +0000)
committerTomas V.V.Cox <cox@php.net>
Tue, 14 May 2002 17:59:41 +0000 (17:59 +0000)
to write to it

pear/PEAR/Config.php

index dcc6b3e1c2510ff6fa628ca9db97fddc62cc9ca1..8e3ed6dbd5e4912c6ef633e8a40ede78e03cf7cd 100644 (file)
@@ -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");