cvs: pearweb /include signatures.php
| From: | Stig Bakken | Date: | Thu, 25 Apr 2002 01:40:37 +0000 |
| Subject: | cvs: pearweb /include signatures.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3537@lists.php.net to get a copy of this message | ||
ssb Wed Apr 24 21:40:37 2002 EDT
Modified files:
/pearweb/include signatures.php
Log:
* cache method signatures
Index: pearweb/include/signatures.php
diff -u pearweb/include/signatures.php:1.6 pearweb/include/signatures.php:1.7
--- pearweb/include/signatures.php:1.6 Wed Nov 7 05:42:39 2001
+++ pearweb/include/signatures.php Wed Apr 24 21:40:37 2002
@@ -22,6 +22,11 @@
function parse_signatures_from_file($file, &$signatures, $out_format = "signatures")
{
+ $cache_file = PEAR_TMPDIR . '/' . basename($file) . '.' . $out_format;
+ if (@filemtime($cache_file) > @filemtime($file)) {
+ $signatures = unserialize(file_get_contents($cache_file));
+ return true;
+ }
$fp = fopen($file, "r");
if (!is_resource($fp)) {
return false;
@@ -118,6 +123,10 @@
}
}
}
+ if ($wp = @fopen($cache_file, "w")) {
+ fwrite($wp, serialize($signatures));
+ fclose($wp);
+ }
return true;
}