summaryrefslogtreecommitdiff
path: root/modules/path
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-05-14 09:23:47 +0000
committerDries Buytaert <dries@buytaert.net>2005-05-14 09:23:47 +0000
commit139ef4027ceae2691eb9c5cc2e1f21df44caa145 (patch)
tree54ab1f79c06cd9f2f9607319365ec69c2614d0b4 /modules/path
parent229e2e4f234fc7b3380e8bf192e3dae48aaabc16 (diff)
downloadbrdo-139ef4027ceae2691eb9c5cc2e1f21df44caa145.tar.gz
brdo-139ef4027ceae2691eb9c5cc2e1f21df44caa145.tar.bz2
- Patch #22035 by mathias/mikeryan: improved performance of path aliases.
Diffstat (limited to 'modules/path')
-rw-r--r--modules/path/path.module10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/path/path.module b/modules/path/path.module
index e1e68e14f..ceedf8cba 100644
--- a/modules/path/path.module
+++ b/modules/path/path.module
@@ -132,11 +132,11 @@ function path_admin_delete($pid = 0) {
function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
if ($path && !$alias) {
db_query("DELETE FROM {url_alias} WHERE src = '%s'", $path);
- drupal_rebuild_path_map();
+ drupal_clear_path_cache();
}
else if (!$path && $alias) {
db_query("DELETE FROM {url_alias} WHERE dst = '%s'", $alias);
- drupal_rebuild_path_map();
+ drupal_clear_path_cache();
}
else if ($path && $alias) {
$path_count = db_result(db_query("SELECT COUNT(src) FROM {url_alias} WHERE src = '%s'", $path));
@@ -145,7 +145,7 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
// We have an insert:
if ($path_count == 0 && $alias_count == 0) {
db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $path, $alias);
- drupal_rebuild_path_map();
+ drupal_clear_path_cache();
}
else if ($path_count >= 1 && $alias_count == 0) {
if ($pid) {
@@ -154,11 +154,11 @@ function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) {
else {
db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $path, $alias);
}
- drupal_rebuild_path_map();
+ drupal_clear_path_cache();
}
else if ($path_count == 0 && $alias_count == 1) {
db_query("UPDATE {url_alias} SET src = '%s' WHERE dst = '%s'", $path, $alias);
- drupal_rebuild_path_map();
+ drupal_clear_path_cache();
}
else if ($path_count == 1 && $alias_count == 1) {
// This will delete the path that alias was originally pointing to: