You are here

public static function fastcache::cache_set in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/fastcache.inc \fastcache::cache_set()

cache_set wrapper.

6 calls to fastcache::cache_set()
DatabaseSchema_sqlsrv::DrupalSpecificFunctions in sqlsrv/schema.inc
Returns a list of functions that are not available by default on SQL Server, but used in Drupal Core or contributed modules because they are available in other databases such as MySQL.
DatabaseSchema_sqlsrv::EngineVersion in sqlsrv/schema.inc
Retrieve Engine Version information.
DatabaseSchema_sqlsrv::getDatabaseInfo in sqlsrv/schema.inc
Get database information from sys.databases
DatabaseSchema_sqlsrv::LoadDefaultSchema in sqlsrv/schema.inc
Load the real default schema name for this connection.
DatabaseSchema_sqlsrv::queryColumnInformation in sqlsrv/schema.inc
Database introspection: fetch technical information about a table.

... See full list

File

sqlsrv/fastcache.inc, line 149

Class

fastcache
Static caching layer.

Code

public static function cache_set($cid, $data, $bin = NULL) {
  static::FixKeyAndBin($cid, $bin);
  static::cache_load_ensure($bin);
  if (static::$fastcacheitems[$bin]->changed == FALSE) {
    static::$fastcacheitems[$bin]->changed = TRUE;

    // Do persist or lock if it is not enabled!
    if (static::Enabled()) {
      static::$fastcacheitems[$bin]->persist = TRUE;
      if (static::$shutdown_registered == FALSE) {
        register_shutdown_function(array(
          'fastcache',
          'fastcache_persist',
        ));
        static::$shutdown_registered = TRUE;
      }
    }
  }
  static::$fastcacheitems[$bin]
    ->data_set($cid, $data);
}