Changeset 52


Ignore:
Timestamp:
09/08/08 22:45:07 (3 years ago)
Author:
angch
Message:

Memcache integration

Location:
drupal5/trunk/sites/all/modules/views
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • drupal5/trunk/sites/all/modules/views/views.module

    r15 r52  
    201201      } 
    202202    } 
    203     cache_set("views_urls", 'cache_views', serialize($views)); 
     203    cache_set("views_urls", 'cache_views', $views); 
    204204  } 
    205205  else { 
    206     $views = unserialize($cache->data); 
     206    $views = $cache->data; 
    207207  } 
    208208 
     
    303303 
    304304  // All views with an empty access setting are available to all roles. 
    305   if (!$view->access) {  
     305  if (!$view->access) { 
    306306    return TRUE; 
    307307  } 
     
    524524    $args = array(); 
    525525  } 
    526    
     526 
    527527  // if no filter values are passed in, get them from the $_GET array 
    528528  if ($filters == NULL) { 
     
    833833function _views_view_fields() { 
    834834  return array( 
    835     'vid' => '%d',  
    836     'name' => "'%s'",  
    837     'description' => "'%s'",  
    838     'access' => "'%s'",  
    839     'page' => '%d',  
    840     'page_title' => "'%s'",  
    841     'page_header' => "'%s'",  
    842     'page_header_format' => '%d',  
    843     'page_footer' => "'%s'",  
    844     'page_footer_format' => '%d',  
    845     'page_empty' => "'%s'",  
    846     'page_empty_format' => '%d',  
    847     'page_type' => "'%s'",  
    848     'use_pager' => '%d',  
    849     'nodes_per_page' => '%d',  
    850     'url' => "'%s'",  
    851     'menu' => '%d',  
    852     'menu_tab' => '%d',  
    853     'menu_tab_default' => '%d',  
    854     'menu_tab_weight' => '%d',  
    855     'menu_title' => "'%s'",  
     835    'vid' => '%d', 
     836    'name' => "'%s'", 
     837    'description' => "'%s'", 
     838    'access' => "'%s'", 
     839    'page' => '%d', 
     840    'page_title' => "'%s'", 
     841    'page_header' => "'%s'", 
     842    'page_header_format' => '%d', 
     843    'page_footer' => "'%s'", 
     844    'page_footer_format' => '%d', 
     845    'page_empty' => "'%s'", 
     846    'page_empty_format' => '%d', 
     847    'page_type' => "'%s'", 
     848    'use_pager' => '%d', 
     849    'nodes_per_page' => '%d', 
     850    'url' => "'%s'", 
     851    'menu' => '%d', 
     852    'menu_tab' => '%d', 
     853    'menu_tab_default' => '%d', 
     854    'menu_tab_weight' => '%d', 
     855    'menu_title' => "'%s'", 
    856856    'menu_tab_default_parent_type' => "'%s'", 
    857     'menu_parent_title' => "'%s'",  
    858     'menu_parent_tab_weight' => '%d',  
    859     'block' => '%d',  
    860     'block_title' => "'%s'",  
    861     'block_use_page_header' => '%d',  
    862     'block_header' => "'%s'",  
    863     'block_header_format' => '%d',  
    864     'block_use_page_footer' => '%d',  
    865     'block_footer' => "'%s'",  
    866     'block_footer_format' => '%d',  
    867     'block_use_page_empty' => '%d',  
    868     'block_empty' => "'%s'",  
    869     'block_empty_format' => '%d',  
    870     'block_type' => "'%s'",  
    871     'nodes_per_block' => '%d',  
    872     'block_more' => '%d',  
    873     'breadcrumb_no_home' => '%d',  
    874     'changed' => '%d',  
    875     'view_args_php' => "'%s'",  
     857    'menu_parent_title' => "'%s'", 
     858    'menu_parent_tab_weight' => '%d', 
     859    'block' => '%d', 
     860    'block_title' => "'%s'", 
     861    'block_use_page_header' => '%d', 
     862    'block_header' => "'%s'", 
     863    'block_header_format' => '%d', 
     864    'block_use_page_footer' => '%d', 
     865    'block_footer' => "'%s'", 
     866    'block_footer_format' => '%d', 
     867    'block_use_page_empty' => '%d', 
     868    'block_empty' => "'%s'", 
     869    'block_empty_format' => '%d', 
     870    'block_type' => "'%s'", 
     871    'nodes_per_block' => '%d', 
     872    'block_more' => '%d', 
     873    'breadcrumb_no_home' => '%d', 
     874    'changed' => '%d', 
     875    'view_args_php' => "'%s'", 
    876876    'is_cacheable' => '%d', 
    877877  ); 
     
    13151315  $form['view'] = array('#type' => 'value', '#value' => $view); 
    13161316  $form['submit'] = array('#type' => 'button', '#name' => '', '#value' => t('Submit')); 
    1317    
     1317 
    13181318  // clean URL get forms breaks if we don't give it a 'q'. 
    13191319  if (!(bool)variable_get('clean_url', '0')) { 
     
    13871387    $form["filter$count"] = $item; 
    13881388  } 
    1389    
     1389 
    13901390  return $form; 
    13911391} 
     
    20002000      $query->add_where("$field $operator NULL"); 
    20012001      break; 
    2002   }   
     2002  } 
    20032003} 
    20042004 
  • drupal5/trunk/sites/all/modules/views/views_cache.inc

    r15 r52  
    2929  if (!$views_arguments) { 
    3030    $data = cache_get("views_arguments:$locale", 'cache_views'); 
    31     $cache = unserialize($data->data); 
     31    $cache = $data->data; 
    3232    if (is_array($cache)) { 
    3333      $views_arguments = $cache; 
     
    5555      } 
    5656      $cache = $views_arguments; 
    57       cache_set("views_arguments:$locale", 'cache_views', serialize($cache)); 
     57      cache_set("views_arguments:$locale", 'cache_views', $cache); 
    5858    } 
    5959  } 
     
    7171  if (!$views_tables) { 
    7272    $data = cache_get("views_tables:$locale", 'cache_views'); 
    73     $cache = unserialize($data->data); 
     73    $cache = $data->data; 
    7474 
    7575    if (is_array($cache)) { 
     
    7878    else { 
    7979      $table_data = module_invoke_all('views_tables'); 
    80        
     80 
    8181      // allow modules to alter the definitions supplied others 
    8282      foreach (module_implements('views_tables_alter') as $module) { 
     
    8484        $function($table_data); 
    8585      } 
    86        
     86 
    8787      $views_tables['tables'] = $table_data; 
    8888 
     
    144144        } 
    145145      } 
    146       cache_set("views_tables:$locale", 'cache_views', serialize($views_tables)); 
     146      cache_set("views_tables:$locale", 'cache_views', $views_tables); 
    147147    } 
    148148  } 
     
    225225  if (!$views_default_views) { 
    226226    $data = cache_get("views_default_views:$locale", 'cache_views'); 
    227     $cache = unserialize($data->data); 
     227    $cache = $data->data; 
    228228 
    229229    if (is_array($cache)) { 
     
    244244        } 
    245245      } 
    246       cache_set("views_default_views:$locale", 'cache_views', serialize($views_default_views)); 
     246      cache_set("views_default_views:$locale", 'cache_views', $views_default_views); 
    247247    } 
    248248  } 
     
    267267function _views_get_query(&$view, $args, $filters) { 
    268268  if ($view->is_cacheable && ($cached = cache_get('views_query:' . $view->name, 'cache_views'))) { 
    269     $info = unserialize($cached->data); 
     269    $info = $cached->data; 
    270270 
    271271    $plugins = _views_get_style_plugins(); 
     
    282282    ); 
    283283    if ($view->is_cacheable) { 
    284       cache_set('views_query:' . $view->name, 'cache_views', serialize($data)); 
     284      cache_set('views_query:' . $view->name, 'cache_views', $data); 
    285285    } 
    286286    $info = array_merge($info, $data); 
     
    314314  if (!$views_style_plugins) { 
    315315    $data = cache_get("views_style_plugins:$locale", 'cache_views'); 
    316     $cache = unserialize($data->data); 
     316    $cache = $data->data; 
    317317    if (is_array($cache)) { 
    318318      $views_style_plugins = $cache; 
     
    329329      } 
    330330      $cache = $views_style_plugins; 
    331       cache_set("views_style_plugins:$locale", 'cache_views', serialize($cache)); 
     331      cache_set("views_style_plugins:$locale", 'cache_views', $cache); 
    332332    } 
    333333  } 
Note: See TracChangeset for help on using the changeset viewer.