[TEP-COMMIT] [CVS catalog] add a clear() method to manually delete cached entries

anonymous-OfajU3CKLf1/[email protected] 18 Mar 2004 16:10:37 -0000
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Commit in catalog/catalog/includes/classes on MAIN

cache.php +14 1.6 -> 1.7

add a clear() method to manually delete cached entries

----------

catalog /catalog /includes /classes

cache.php 1.6 -> 1.7

diff -u -r1.6 -r1.7
--- cache.php 2004/02/16 06:31:50 1.6
+++ cache.php 2004/03/18 16:10:36 1.7
@@ -92,5 +92,19 @@

$this->write($this->cache_key, $this->cached_data);
}

+
+ function clear($key) {
+ $key_length = strlen($key);
+
+ $d = dir(DIR_FS_WORK);
+
+ while ($entry = $d->read()) {
+ if ((strlen($entry) >= $key_length) && (substr($entry, 0, $key_length) == $key)) {
+ @unlink(DIR_FS_WORK . $entry);
+ }
+ }
+
+ $d->close();
+ }

}
?>

CVSspam 0.2.8

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click