cvs: php4 /pear/PEAR Config.php
| From: | Tomas V.V.Cox | Date: | Tue, 14 May 2002 17:59:41 +0000 |
| Subject: | cvs: php4 /pear/PEAR Config.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3822@lists.php.net to get a copy of this message | ||
cox Tue May 14 13:59:41 2002 EDT
Modified files:
/php4/pear/PEAR Config.php
Log:
Try to create the dir where the conf file resides before trying
to write to it
Index: php4/pear/PEAR/Config.php
diff -u php4/pear/PEAR/Config.php:1.18 php4/pear/PEAR/Config.php:1.19
--- php4/pear/PEAR/Config.php:1.18 Thu May 2 19:56:44 2002
+++ php4/pear/PEAR/Config.php Tue May 14 13:59:41 2002
@@ -16,7 +16,7 @@
// | Author: Stig Bakken <ssb@fast.no> |
// +----------------------------------------------------------------------+
//
-// $Id: Config.php,v 1.18 2002/05/02 23:56:44 ssb Exp $
+// $Id: Config.php,v 1.19 2002/05/14 17:59:41 cox Exp $
require_once 'PEAR.php';
@@ -341,7 +341,10 @@
}
$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");