You are here

public function RenderStack::callOriginalFunction in Render cache 7.2

This calls the given original function by replacing the global $conf variable, calling the function and putting it back.

Parameters

string $function: The function to call, the arguments are gotton via func_get_args().

Return value

NULL|mixed Returns what the original function returns.

3 calls to RenderStack::callOriginalFunction()
RenderStack::drupal_add_assets in src/Cache/RenderStack.php
Helper function to add JS/CSS assets to the recursion storage.
RenderStack::drupal_add_library in src/Cache/RenderStack.php
Helper function to add library assets to the recursion storage.
RenderStack::drupal_process_attached in src/Cache/RenderStack.php
Helper function to add any #attached assets to the recursion storage.

File

src/Cache/RenderStack.php, line 502
Contains \Drupal\render_cache\Cache\RenderStack

Class

RenderStack
Defines the RenderStack service.

Namespace

Drupal\render_cache\Cache

Code

public function callOriginalFunction($function) {
  global $conf;
  $args = func_get_args();
  array_shift($args);
  $name = $function . "_function";
  $old = $conf[$name];
  unset($conf[$name]);
  $return = call_user_func_array($function, $args);
  $conf[$name] = $old;
  return $return;
}