summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-11 16:56:10 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-11 16:56:10 +0000
commitd10a1f700656aef306300e122a12051d4b4b03b7 (patch)
tree2bfe1af43a8d21192c104fc420bc5dc60360e476 /includes
parent3b8013e20de51ed9c693bfef339aeae7b11205ad (diff)
downloadbrdo-d10a1f700656aef306300e122a12051d4b4b03b7.tar.gz
brdo-d10a1f700656aef306300e122a12051d4b4b03b7.tar.bz2
- Patch #651902 by chx, Damien Tournoud, scor: allow ESI tie in.
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc15
1 files changed, 11 insertions, 4 deletions
diff --git a/includes/common.inc b/includes/common.inc
index e8734e0c5..fdc0b40c2 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5070,14 +5070,15 @@ function drupal_render(&$elements) {
$prefix = isset($elements['#prefix']) ? $elements['#prefix'] : '';
$suffix = isset($elements['#suffix']) ? $elements['#suffix'] : '';
+ $output = $prefix . $elements['#children'] . $suffix;
// Cache the processed element if #cache is set.
if (isset($elements['#cache'])) {
- drupal_render_cache_set($prefix . $elements['#children'] . $suffix, $elements);
+ drupal_render_cache_set($output, $elements);
}
$elements['#printed'] = TRUE;
- return $prefix . $elements['#children'] . $suffix;
+ return $output;
}
/**
@@ -5198,13 +5199,19 @@ function drupal_render_cache_get($elements) {
* @param $elements
* A renderable array.
*/
-function drupal_render_cache_set($markup, $elements) {
+function drupal_render_cache_set(&$markup, $elements) {
// Create the cache ID for the element.
if (!in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) || !$cid = drupal_render_cid_create($elements)) {
return FALSE;
}
- $data['#markup'] = $markup;
+ // Cache implementations are allowed to modify the markup, to support
+ // replacing markup with edge-side include commands. The supporting cache
+ // backend will store the markup in some other key (like
+ // $data['#real-value']) and return an include command instead. When the
+ // ESI command is executed by the content accelerator, the real value can
+ // be retrieved and used.
+ $data['#markup'] = &$markup;
// Persist attached data associated with this element.
if (isset($elements['#attached'])) {
$data['#attached'] = $elements['#attached'];