summaryrefslogtreecommitdiff
path: root/modules/node
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-08-30 15:31:46 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-08-30 15:31:46 +0000
commit4e0071fb8a44c5a91f46638a8414379fa68dad04 (patch)
tree71d08d03cbefb370701a758f21078b47ffefe0f4 /modules/node
parentbfb72d0ec913b9ba423c6c252fb274929d08e2f3 (diff)
downloadbrdo-4e0071fb8a44c5a91f46638a8414379fa68dad04.tar.gz
brdo-4e0071fb8a44c5a91f46638a8414379fa68dad04.tar.bz2
#111127 rollback by chx, slightly extended: roll back node_load cache, it needs more thought and discussion, so postponed until at least Drupal 7
Diffstat (limited to 'modules/node')
-rw-r--r--modules/node/node.module28
-rw-r--r--modules/node/node.schema2
2 files changed, 1 insertions, 29 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index b2b4613e4..6b6f6c7f8 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -444,7 +444,6 @@ function node_type_delete($type) {
*/
function node_type_update_nodes($old_type, $type) {
db_query("UPDATE {node} SET type = '%s' WHERE type = '%s'", $type, $old_type);
- cache_clear_all('*', 'cache_node', TRUE);
return db_affected_rows();
}
@@ -601,17 +600,6 @@ function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
/**
* Load a node object from the database.
*
- * This function provides two levels of caching. The internal cache stores
- * all nodes loaded in this request. Use the $reset argument to invalidate
- * it. The cache API based cache stores all nodes throughout requests,
- * until invalidated with cache_clear_all().
- *
- * If the load operation was cached previously, we load the data from
- * that cache, and no nodeapi load operations are called. That means,
- * that we expect all load operations to return the same data and do
- * not use any conditions on the user, language or anything else,
- * which would limit what is stored in the node_load cache.
- *
* @param $param
* Either the nid of the node or an array of conditions to match against in the database query
* @param $revision
@@ -633,13 +621,7 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
$arguments = array();
if (is_numeric($param)) {
if ($cachable) {
- if (!isset($nodes[$param])) {
- if ($cache = cache_get($param, 'cache_node')) {
- $nodes[$param] = $cache->data;
- }
- }
- // Either the node was statically cached or we loaded from the
- // cache_node table.
+ // Is the node statically cached?
if (isset($nodes[$param])) {
return is_object($nodes[$param]) ? drupal_clone($nodes[$param]) : $nodes[$param];
}
@@ -685,11 +667,6 @@ function node_load($param = array(), $revision = NULL, $reset = NULL) {
}
if ($cachable) {
$nodes[$node->nid] = is_object($node) ? drupal_clone($node) : $node;
- // We can only cache when a nid is given, otherwise the conditions are
- // too dynamic to be cacheable.
- if (is_numeric($param)) {
- cache_set($param, $nodes[$node->nid], 'cache_node');
- }
}
}
@@ -886,8 +863,6 @@ function node_save(&$node) {
// Clear the page and block caches.
cache_clear_all();
- // Clear the node load cache for this node.
- cache_clear_all($node->nid, 'cache_node');
}
/**
@@ -1218,7 +1193,6 @@ function node_user($op, &$edit, &$user) {
if ($op == 'delete') {
db_query('UPDATE {node} SET uid = 0 WHERE uid = %d', $user->uid);
db_query('UPDATE {node_revisions} SET uid = 0 WHERE uid = %d', $user->uid);
- cache_clear_all('*', 'cache_node', TRUE);
}
}
diff --git a/modules/node/node.schema b/modules/node/node.schema
index 76e942341..34e77b325 100644
--- a/modules/node/node.schema
+++ b/modules/node/node.schema
@@ -105,7 +105,5 @@ function node_schema() {
'primary key' => array('type'),
);
- $schema['cache_node'] = drupal_get_schema_unprocessed('system', 'cache');
-
return $schema;
}