Avoid CiviCRM running full drupal cache flush, as this results in CiviCRM clobbering...
authorTorrance <torrance123@gmail.com>
Wed, 5 Aug 2015 03:24:00 +0000 (15:24 +1200)
committerTorrance <torrance123@gmail.com>
Wed, 5 Aug 2015 03:24:00 +0000 (15:24 +1200)
CRM/Utils/System/Drupal8.php

index 9a714a7d077f7015ab18b40532ae97eaf0bdc897..7de4b715090be3d1352c345c37cb8eefa1f998e6 100644 (file)
@@ -540,4 +540,15 @@ class CRM_Utils_System_Drupal8 extends CRM_Utils_System_DrupalBase {
     return 'sidebar_first';
   }
 
+  /**
+   * @inheritDoc
+   */
+  public function flush() {
+    // CiviCRM and Drupal both provide (different versions of) Symfony (and possibly share other classes too).
+    // If we call drupal_flush_all_caches(), Drupal will attempt to rediscover all of its classes, use Civicrm's
+    // alternatives instead and then die. Instead, we only clear cache bins and no more.
+    foreach (Drupal\Core\Cache\Cache::getBins() as $service_id => $cache_backend) {
+      $cache_backend->deleteAll();
+    }
+  }
 }