Commit 8832b862 authored by robertDouglass's avatar robertDouglass
Browse files

making provision for flushing cached aliases when cache is dirty

parent 8636519a
......@@ -4,14 +4,13 @@ RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.13
diff -u -r1.13 path.inc
--- includes/path.inc 23 Dec 2006 22:04:52 -0000 1.13
+++ includes/path.inc 13 Jan 2007 20:43:53 -0000
@@ -52,14 +52,31 @@
+++ includes/path.inc 13 Jan 2007 20:52:50 -0000
@@ -52,14 +52,30 @@
if ($action == 'wipe') {
$map = array();
$no_src = array();
+ dmemcache_flush('alias');
+ dmemcache_flush('src');
+ dmemcache_flush('path_count');
}
elseif ($count > 0 && $path != '') {
if ($action == 'alias') {
......@@ -37,7 +36,7 @@ diff -u -r1.13 path.inc
return $alias;
}
// Check $no_src for this $path in case we've already determined that there
@@ -67,9 +84,14 @@
@@ -67,9 +83,14 @@
elseif ($action == 'source' && !isset($no_src[$path])) {
// Look for the value $path within the cached $map
if (!$src = array_search($path, $map)) {
......@@ -53,7 +52,7 @@ diff -u -r1.13 path.inc
else {
// We can't record anything into $map because we do not have a valid
// index and there is no need because we have not learned anything
@@ -77,6 +99,7 @@
@@ -77,6 +98,7 @@
$no_src[$path] = TRUE;
}
}
......@@ -61,3 +60,29 @@ diff -u -r1.13 path.inc
return $src;
}
}
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.105
diff -u -r1.105 path.module
--- modules/path/path.module 9 Jan 2007 08:34:03 -0000 1.105
+++ modules/path/path.module 13 Jan 2007 20:52:50 -0000
@@ -118,6 +118,8 @@
* Post-confirmation; delete an URL alias.
*/
function path_admin_delete($pid = 0) {
+ dmemcache_flush('src');
+ dmemcache_flush('alias');
db_query('DELETE FROM {url_alias} WHERE pid = %d', $pid);
drupal_set_message(t('The alias has been deleted.'));
}
@@ -128,6 +130,9 @@
* Set an aliased path for a given Drupal path, preventing duplicates.
*/
function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
+ dmemcache_flush('src');
+ dmemcache_flush('alias');
+
if ($path && !$alias) {
db_query("DELETE FROM {url_alias} WHERE src = '%s'", $path);
drupal_clear_path_cache();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment