/[drupal]/drupal/includes/cache-install.inc
ViewVC logotype

Contents of /drupal/includes/cache-install.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (show annotations) (download) (as text)
Tue Nov 3 05:18:06 2009 UTC (3 weeks ago) by webchick
Branch: MAIN
CVS Tags: DRUPAL-7-0-UNSTABLE-10, HEAD
Changes since 1.5: +26 -6 lines
File MIME type: text/x-php
#605880 by bleen18 and David_Rothstein: Fix weird bugs with settings and menus after install due to faulty caching.
1 <?php
2 // $Id: cache-install.inc,v 1.5 2009/09/13 17:49:51 dries Exp $
3
4 /**
5 * A stub cache implementation to be used during the installation
6 * process when database access is not yet available. Because Drupal's
7 * caching system never requires that cached data be present, these
8 * stub functions can short-circuit the process and sidestep the
9 * need for any persistent storage. Obviously, using this cache
10 * implementation during normal operations would have a negative impact
11 * on performance.
12 */
13 class DrupalFakeCache extends DrupalDatabaseCache implements DrupalCacheInterface {
14 function get($cid) {
15 return FALSE;
16 }
17
18 function getMultiple(&$cids) {
19 return array();
20 }
21
22 function set($cid, $data, $expire = CACHE_PERMANENT, array $headers = NULL) {
23 }
24
25 function clear($cid = NULL, $wildcard = FALSE) {
26 // If there is a database cache, attempt to clear it whenever possible. The
27 // reason for doing this is that the database cache can accumulate data
28 // during installation due to any full bootstraps that may occur at the
29 // same time (for example, AJAX requests triggered by the installer). If we
30 // didn't try to clear it whenever this function is called, the data in the
31 // cache would become stale; for example, the installer sometimes calls
32 // variable_set(), which updates the {variable} table and then clears the
33 // cache to make sure that the next page request picks up the new value.
34 // Not actually clearing the cache here therefore leads old variables to be
35 // loaded on the first page requests after installation, which can cause
36 // subtle bugs, some of which would not be fixed unless the site
37 // administrator cleared the cache manually.
38 try {
39 if (function_exists('drupal_install_initialize_database')) {
40 drupal_install_initialize_database();
41 parent::clear($cid, $wildcard);
42 }
43 }
44 // If the attempt at clearing the cache causes an error, that means that
45 // either the database connection is not set up yet or the relevant cache
46 // table in the database has not yet been created, so we can safely do
47 // nothing here.
48 catch (Exception $e) {
49 }
50 }
51
52 function isEmpty() {
53 return TRUE;
54 }
55 }

  ViewVC Help
Powered by ViewVC 1.1.2