cvs: pear-core /PEAR REST.php
| From: | Pierre-Alain Joye | Date: | Thu, 02 Mar 2006 03:09:31 +0000 |
| Subject: | cvs: pear-core /PEAR REST.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-38834@lists.php.net to get a copy of this message | ||
pajoye Thu Mar 2 03:09:31 2006 UTC
Modified files:
/pear-core/PEAR REST.php
Log:
- try to recover simple cache errors, a bit hackish but has the merit
to do not leave errors like non existent cache dir...
http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/REST.php?r1=1.19&r2=1.20&diff_format=u
Index: pear-core/PEAR/REST.php
diff -u pear-core/PEAR/REST.php:1.19 pear-core/PEAR/REST.php:1.20
--- pear-core/PEAR/REST.php:1.19 Fri Jan 6 04:47:36 2006
+++ pear-core/PEAR/REST.php Thu Mar 2 03:09:31 2006
@@ -15,7 +15,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: REST.php,v 1.19 2006/01/06 04:47:36 cellog Exp $
+ * @version CVS: $Id: REST.php,v 1.20 2006/03/02 03:09:31 pajoye Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.4.0a1
*/
@@ -204,10 +204,21 @@
if ($cacheid === null && $nochange) {
$cacheid = unserialize(implode('', file($cacheidfile)));
}
+
$fp = @fopen($cacheidfile, 'wb');
if (!$fp) {
- return false;
+ $cache_dir = $this->config->get('cache_dir');
+ if (!is_dir($cache_dir)) {
+ System::mkdir(array('-p', $cache_dir));
+ $fp = @fopen($cacheidfile, 'wb');
+ if (!$fp) {
+ return false;
+ }
+ } else {
+ return false;
+ }
}
+
if ($nochange) {
fwrite($fp, serialize(array(
'age' => time(),
@@ -383,4 +394,4 @@
return $data;
}
}
-?>
\ No newline at end of file
+?>