private function replace($old, $new, $replaceEngine = null)
{
if (!isset($replaceEngine)) {
$replaceEngine = new \FileTextSearch();
}
$replaceEngine->setExtensions(array('tpl', 'css'));
$replaceEngine->setSearchKey($old);
$replaceEngine->setReplacementKey($new);
$replaceEngine->findReplace($this->root);
$tpl1_name = $old;
$tpl2_name = $new;
if (pathinfo($old, PATHINFO_EXTENSION) == 'tpl') {
$tpl1_name = ' ' . $old;
$tpl2_name = ' ' . $new;
}
$replaceEngine->setSearchKey($tpl1_name);
$replaceEngine->setReplacementKey($tpl2_name);
$replaceEngine->findReplace($this->root);
}