diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-13 09:17:12 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-03-13 09:17:12 -0700 |
commit | c29e269956ca92d83c62ccef4fda6c571e802101 (patch) | |
tree | 70c23817006e8025ffea0ede297a580fbef11976 /modules/rdf | |
parent | b5dc528a6672356204774da3f6f6553b545092a9 (diff) | |
download | brdo-c29e269956ca92d83c62ccef4fda6c571e802101.tar.gz brdo-c29e269956ca92d83c62ccef4fda6c571e802101.tar.bz2 |
Revert "Issue #1089040 by Remon, mlncn: Added Cache rdf_get_namespaces() using drupal_static(). Don't add caches unless there's a demonstrated performance degradation.""
This reverts commit de30adeb093789e232cadbb23be000790402ee8d.
Diffstat (limited to 'modules/rdf')
-rw-r--r-- | modules/rdf/rdf.module | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/modules/rdf/rdf.module b/modules/rdf/rdf.module index 214b87b4b..70b684c68 100644 --- a/modules/rdf/rdf.module +++ b/modules/rdf/rdf.module @@ -95,26 +95,23 @@ function rdf_rdf_namespaces() { * hook_rdf_namespaces(). */ function rdf_get_namespaces() { - $rdf_namespaces = &drupal_static(__FUNCTION__); - if (!isset($rdf_namespaces)) { - $rdf_namespaces = module_invoke_all('rdf_namespaces'); - // module_invoke_all() uses array_merge_recursive() which might return - // nested arrays if several modules redefine the same prefix multiple - // times. We need to ensure the array of namespaces is flat and only - // contains strings as URIs. - foreach ($rdf_namespaces as $prefix => $uri) { - if (is_array($uri)) { - if (count(array_unique($uri)) == 1) { - // All namespaces declared for this prefix are the same, merge them - // all into a single namespace. - $rdf_namespaces[$prefix] = $uri[0]; - } - else { - // There are conflicting namespaces for this prefix, do not include - // duplicates in order to avoid asserting any inaccurate RDF - // statements. - unset($rdf_namespaces[$prefix]); - } + $rdf_namespaces = module_invoke_all('rdf_namespaces'); + // module_invoke_all() uses array_merge_recursive() which might return nested + // arrays if several modules redefine the same prefix multiple times. We need + // to ensure the array of namespaces is flat and only contains strings as + // URIs. + foreach ($rdf_namespaces as $prefix => $uri) { + if (is_array($uri)) { + if (count(array_unique($uri)) == 1) { + // All namespaces declared for this prefix are the same, merge them all + // into a single namespace. + $rdf_namespaces[$prefix] = $uri[0]; + } + else { + // There are conflicting namespaces for this prefix, do not include + // duplicates in order to avoid asserting any inaccurate RDF + // statements. + unset($rdf_namespaces[$prefix]); } } } |