cache

serialize is bad, mkay

  1. /**
  2.  * Wrapper function to perform string to array conversion of lookup cache.
  3.  */
  4. function _registry_get_lookup_cache() {
  5.   $lookup_cache = array();

Changing Form Cache for AHAH manipulation

  1. function ehu_photos_js() {
  2.   $cache = cache_get('form_'.$_POST['form_build_id'], 'cache_form');
  3.  
  4.   $node = (object)$_POST;
  5.   $form = $cache->data;
  6.   $form_state = array('values' => $_POST);

Fix for user warning: in /.../html/includes/cache.inc on line 109." message when savig module page (admin/build/modules)

  1. function cache_set($cid, $data, $table = 'cache', $expire = CACHE_PERMANENT, $headers = NULL) {
  2.   $serialized = 0;
  3.   if (is_object($data) || is_array($data)) {
  4.     $data = serialize($data);

user warning: in /.../html/includes/cache.inc on line 109." message when savig module page (admin/build/modules)

  1. db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid);

Cache Saving test

  1. class CacheSavingCase extends DrupalWebTestCase {
  2.   /**
  3.    * Implementation of getInfo().
  4.    */
  5.   function getInfo() {
  6.     return array(
  7.       'name' => t('Cache saving test'),
Syndicate content