Exemplo n.º 1
0
while (true) {
    $l = fgets($f);
    if (preg_match("#^[ \t]*namespace ([a-z\\\\0-9]+);#i", $l, $regs)) {
        $namespace = $regs[1] . '\\';
        break;
    }
    if (preg_match('#function|class#i', $l)) {
        break;
    }
    if (++$i > 20) {
        break;
    }
}
fseek($f, $offset);
$str = '';
$open = $close = 0;
while (false !== ($l = fgets($f))) {
    $open += substr_count($l, '{');
    $close += substr_count($l, '}');
    $str .= $l;
    if ($open > 0 && $close >= $open) {
        break;
    }
}
fclose($f);
$str = CBitrixLiveapi::Beautiful($str, $name, $namespace, $file, $line, $_REQUEST['highlight']);
if (defined('BX_UTF') && BX_UTF) {
    $str = $APPLICATION->ConvertCharSet($str, 'cp1251', 'utf8');
}
echo $str;
require $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_admin_after.php";