} $last_version = 0; if (!($ver_dir = opendir($ver_path = $path . '/' . $module_id))) { die('Cannot read ' . $ver_path); } while (false !== ($ver = readdir($ver_dir))) { if ($ver == '.' || $ver == '..' || !is_dir($ver_path . '/' . $ver)) { continue; } if (version_compare($ver, $last_version, '>')) { $mtime = filemtime($ver_path . '/' . $ver); $last_version = $ver; } } closedir($ver_dir); if ($version = CBitrixLiveapi::GetModuleVersion($ver_path . '/' . $last_version, $module_id)) { $last_version = $version; } if ($last_version) { echo '<tr> <td><a href="?module_id=' . urlencode($module_id) . '">' . htmlspecialchars($module_id) . '</a></td> <td><a href="?module_id=' . urlencode($module_id) . '&version=' . urlencode($last_version) . '">' . htmlspecialchars($last_version) . '</a></td> <td>' . ConvertTimeStamp($mtime, 'FULL') . '</a></td> </tr>'; } } echo '</table>'; closedir($dir); } echo '</div>'; #########################################
function ScanDir($path) { $arRes = array(); if (is_dir($path)) { if (!($dir = opendir($path))) { die('Cannot read ' . $path); } while (false !== ($file = readdir($dir))) { if ($file == '.' || $file == '..') { continue; } $arRes = self::ResMerge($arRes, self::ScanDir($path . '/' . $file)); } closedir($dir); } elseif (is_file($path) && preg_match('#\\.(php)$#', $path, $regs)) { return CBitrixLiveapi::ParseFile($path); } return $arRes; }
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";
echo '<tr>' . "<td valign=top class=code>" . $str . "</td>" . '</tr>'; } } echo '</table>'; } } elseif ($_REQUEST['show_diff']) { $DATA_OLD = CBitrixLiveapi::ReadOld(); foreach ($DATA as $module_id => $v) { if ($v != $DATA_OLD[$module_id]) { echo '<h2><a href="?module_id=' . $module_id . '">' . $module_id . '</a></h2>'; $ar_new = unserialize($v); $ar_old = unserialize($DATA_OLD[$module_id]); if (count($tmp = array_diff_assoc($ar_new[0], $ar_old[0]))) { echo '<table border=1 cellpadding=4 cellspacing=0>'; foreach ($tmp as $k => $v) { echo '<tr>' . '<td class="method">' . GetMessage("BITRIX_LIVEAPI_METOD1") . '</td>' . '<td class="code">' . CBitrixLiveapi::colorize($k, $v, false, $module_id) . '</td>' . '</tr>'; } echo '</table>'; } if (count($tmp = array_diff_assoc($ar_new[1], $ar_old[1]))) { echo '<table border=1 cellpadding=4 cellspacing=0>'; foreach ($tmp as $const => $func) { $ar = $ar_new[0][$func]; $link = "bitrix.liveapi_live_src.php?module_id={$module_id}&name={$func}&highlight=" . $const . '#' . $const; echo '<tr>' . '<td class="const">' . GetMessage("BITRIX_LIVEAPI_KONSTANTA1") . '</td>' . "<td class=code><a href='{$link}' target=_blank>{$const}</a> ({$func})</td>" . '</tr>'; } echo '</table>'; } if (count($tmp = array_diff_assoc($ar_new[2], $ar_old[2]))) { echo '<table border=1 cellpadding=4 cellspacing=0>'; foreach ($tmp as $evt => $func) {