From 51796e5618d6f5a65f12a6165daf5e232f6e019d Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Thu, 27 Oct 2011 21:02:11 +0000
Subject: [PATCH] [gh-204] Merging from testing into staging -c1204

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1216 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 .../modules/unl/unl_varnish/unl_varnish.module | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/sites/all/modules/unl/unl_varnish/unl_varnish.module b/sites/all/modules/unl/unl_varnish/unl_varnish.module
index 0fe2f0d4..2ba80c43 100644
--- a/sites/all/modules/unl/unl_varnish/unl_varnish.module
+++ b/sites/all/modules/unl/unl_varnish/unl_varnish.module
@@ -44,27 +44,19 @@ function unl_varnish_purge_submit($form, &$form_state) {
  * Implements hook_file_insert().
  */
 function unl_varnish_file_insert($file) {
-  _unl_varnish_purge_file($file);
+  varnish_purge_all_pages();
 }
 
 /**
  * Implements hook_file_update().
  */
 function unl_varnish_file_update($file) {
-  _unl_varnish_purge_file($file);
+  varnish_purge_all_pages();
 }
 
 /**
- * Instructs varnish to purge the given file from its cache.
- * @param stdClass $file as provided by hook_file_[insert,update]
+ * Implements hook_node_update().
  */
-function _unl_varnish_purge_file($file) {
-  $url = parse_url(file_create_url($file->uri));
-  $host = $url['host'];
-  $path = $url['path'];
-  
-  $command = "purge req.http.host == $host && req.url ~ ^$path\$";
-  _varnish_terminal_run($command);
+function unl_varnish_node_update($node) {
+  varnish_purge_all_pages();
 }
-
-
-- 
GitLab