You are here

function _cdn_eval_pick_server in CDN 6.2

Helper function to evaluate CDN_PICK_SERVER_PHP_CODE_VARIABLE, when that is being used instead of an actual cdn_pick_server() function.

Parameters

$php_code: The PHP code to be evaluated.

$servers_for_file: The $servers_for_file parameter, as it will be available to the eval()'d $php_code. This variable is not passed by reference, hence it will not be changed outside the scope of this function.

2 calls to _cdn_eval_pick_server()
cdn_admin_other_settings_form_validate in ./cdn.admin.inc
Default validate callback for the other settings form.
cdn_file_url_alter in ./cdn.module
Implementation of hook_file_url_alter().

File

./cdn.module, line 805

Code

function _cdn_eval_pick_server($php_code, $servers_for_file) {
  ob_start();
  $result = @eval($php_code);
  ob_end_clean();
  return $result;
}