Bug Tracker

Show
Ignore:
Timestamp:
12/08/07 20:00:19 (2 years ago)
Author:
mike.hostetler
Message:

Updated to latest version of the plugins site

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • site/plugins/includes/cache.inc

    r2219 r4080  
    11<?php 
    2 // $Id: cache.inc,v 1.5 2006/11/10 07:26:27 drumm Exp $ 
     2// $Id: cache.inc,v 1.5.2.4 2007/06/27 03:35:48 drumm Exp $ 
    33 
    44/** 
     
    1818  if ($cache_flush && ($cache_flush + variable_get('cache_lifetime', 0) <= time())) { 
    1919    // Time to flush old cache data 
    20     db_query("DELETE FROM {%s} WHERE expire != %d AND expire <= %d", $table, CACHE_PERMANENT, $cache_flush); 
     20    db_query("DELETE FROM {". $table ."} WHERE expire != %d AND expire <= %d", CACHE_PERMANENT, $cache_flush); 
    2121    variable_set('cache_flush', 0); 
    2222  } 
    2323 
    24   $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {%s} WHERE cid = '%s'", $table, $key)); 
     24  $cache = db_fetch_object(db_query("SELECT data, created, headers, expire FROM {". $table ."} WHERE cid = '%s'", $key)); 
    2525  if (isset($cache->data)) { 
    2626    // If the data is permanent or we're not enforcing a minimum cache lifetime 
     
    9393function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) { 
    9494  db_lock_table($table); 
    95   db_query("UPDATE {%s} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $table, $data, time(), $expire, $headers, $cid); 
     95  db_query("UPDATE {". $table. "} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, time(), $expire, $headers, $cid); 
    9696  if (!db_affected_rows()) { 
    97     @db_query("INSERT INTO {%s} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $table, $cid, $data, time(), $expire, $headers); 
     97    @db_query("INSERT INTO {". $table. "} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, time(), $expire, $headers); 
    9898  } 
    9999  db_unlock_tables(); 
     
    142142        // Clear the cache for everyone, cache_flush_delay seconds have 
    143143        // passed since the first request to clear the cache. 
    144         db_query("DELETE FROM {%s} WHERE expire != %d AND expire < %d", $table, CACHE_PERMANENT, time()); 
     144        db_query("DELETE FROM {". $table. "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time()); 
    145145        variable_set('cache_flush', 0); 
    146146      } 
     
    148148    else { 
    149149      // No minimum cache lifetime, flush all temporary cache entries now. 
    150       db_query("DELETE FROM {%s} WHERE expire != %d AND expire < %d", $table, CACHE_PERMANENT, time()); 
     150      db_query("DELETE FROM {". $table. "} WHERE expire != %d AND expire < %d", CACHE_PERMANENT, time()); 
    151151    } 
    152152  } 
     
    154154    if ($wildcard) { 
    155155      if ($cid == '*') { 
    156         db_query("TRUNCATE TABLE {%s}", $table); 
     156        db_query("DELETE FROM {". $table. "}"); 
    157157      } 
    158158      else { 
    159         db_query("DELETE FROM {%s} WHERE cid LIKE '%s%%'", $table, $cid); 
     159        db_query("DELETE FROM {". $table. "} WHERE cid LIKE '%s%%'", $cid); 
    160160      } 
    161161    } 
    162162    else { 
    163       db_query("DELETE FROM {%s} WHERE cid = '%s'", $table, $cid); 
     163      db_query("DELETE FROM {". $table. "} WHERE cid = '%s'", $cid); 
    164164    } 
    165165  }