private function ParseMaster::_replacement in Advanced CSS/JS Aggregation 7
Same name and namespace in other branches
- 8.4 advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 8.2 advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 8.3 advagg_js_minify/jspacker.inc \ParseMaster::_replacement()
- 6 advagg_js_compress/jspacker.inc \ParseMaster::_replacement()
- 7.2 advagg_js_compress/jspacker.inc \ParseMaster::_replacement()
File
- advagg_js_compress/
jspacker.inc, line 659
Class
Code
private function _replacement($arguments) {
if (empty($arguments)) {
return '';
}
$i = 1;
$j = 0;
// loop through the patterns
while (isset($this->_patterns[$j])) {
$pattern = $this->_patterns[$j++];
// do we have a result?
if (isset($arguments[$i]) && $arguments[$i] != '') {
$replacement = $pattern[self::REPLACEMENT];
if (is_array($replacement) && isset($replacement['fn'])) {
if (isset($replacement['data'])) {
$this->buffer = $replacement['data'];
}
return call_user_func(array(
&$this,
$replacement['fn'],
), $arguments, $i);
}
elseif (is_int($replacement)) {
return $arguments[$replacement + $i];
}
$delete = $this->escapeChar == '' || strpos($arguments[$i], $this->escapeChar) === false ? '' : "\1" . $arguments[$i] . "\1";
return $delete . $replacement;
// skip over references to sub-expressions
}
else {
$i += $pattern[self::LENGTH];
}
}
}