You are here

function _features_remove_recursion in Features 7.2

Callback function for preg_replace_callback() to remove recursion.

The regular expression in calling code is '#(r|R):([0-9]+);#'. The source string is a serialized array or object. The modified source string will be sent back to unserialize(), so all replacements must be compatible with that.

@internal Designed for internal use within

Parameters

string[] $m: Match parts from preg_replace_callback(). $m[0] contains the complete matching fragment for "(r|R):([0-9]+);". $m[1] contains the sub-fragment for "(r|R)". $m[2] contains the sub-fragment for "([0-9]+)".

Return value

string Replacement string fragment.

See also

features_remove_recursion().

preg_replace_callback()

1 string reference to '_features_remove_recursion'
features_remove_recursion in ./features.export.inc
Returns a deep copy of the object or array without recursion.

File

./features.export.inc, line 1635
Contains functions that export configuration into feature modules.

Code

function _features_remove_recursion($m) {
  $r = "\0{$m[1]}ecursion_features";
  return 's:' . strlen($r . $m[2]) . ':"' . $r . $m[2] . '";';
}