From 7cada0f3cead20dc1f197d4aa5f8eaf65b88230e Mon Sep 17 00:00:00 2001
From: Ryan Jacobs <rjacobs@422459.no-reply.drupal.org>
Date: Fri, 6 Apr 2012 12:13:14 -0500
Subject: [PATCH] Issue #1425156: bypass dynamic_cache in admin contexts.

---
 dynamic_cache.module |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dynamic_cache.module b/dynamic_cache.module
index b4dfa85..b03b5a3 100755
--- a/dynamic_cache.module
+++ b/dynamic_cache.module
@@ -8,6 +8,15 @@
  * Implementation of hook_boot().
  */
 function dynamic_cache_boot() {
+  // First check if we are in a special context where the bootstrap should NOT 
+  // be altered, regardless of caching options.
+  // @TODO: Identify any other exceptions where we should force a bypass.
+  if (strpos($_SERVER['PHP_SELF'], 'index.php') === FALSE // Bootstrap called outside of normal index.php page (e.g. cron.php) 
+      || defined('DRUSH_BOOTSTRAP_DRUPAL_FULL')) { // We are in a drush context (drush constants defined)
+    return;
+  }
+  
+  // Hijack the bootstrap
   if ($GLOBALS['conf']['cache'] == CACHE_DISABLED) {
   
     // First, complete remaining DRUPAL_BOOTSTRAP_LATE_PAGE_CACHE steps from from _drupal_bootstrap() in includes/bootstrap.inc.
-- 
1.7.7.5 (Apple Git-26)

