• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP html_diff函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中html_diff函数的典型用法代码示例。如果您正苦于以下问题:PHP html_diff函数的具体用法?PHP html_diff怎么用?PHP html_diff使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了html_diff函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln('<head><style>' . file_get_contents(dirname(dirname(dirname(__DIR__))) . '/res/css/diff.css') . '</style></head>');
     $sourceFile = $input->getArgument('pathSource');
     $targetFile = $input->getArgument('pathCompare');
     $sourceCode = explode("\n", file_get_contents($sourceFile));
     $targetCode = explode("\n", file_get_contents($targetFile));
     array_shift($sourceCode);
     array_shift($targetCode);
     $output->write(html_diff(join("\n", $sourceCode), join("\n", $targetCode)));
 }
开发者ID:original-brownbear,项目名称:htmldiff,代码行数:11,代码来源:DiffCommand.php


示例2: _tpl_act_changes

 function _tpl_act_changes(&$event, $param)
 {
     global $TEXT;
     global $PRE;
     global $SUF;
     if ('changes' != $event->data) {
         return;
     }
     html_edit($TEXT);
     echo '<br id="scroll__here" />';
     html_diff(con($PRE, $TEXT, $SUF));
     $event->preventDefault();
     return;
 }
开发者ID:omusico,项目名称:isle-web-framework,代码行数:14,代码来源:action.php


示例3: diff

 public function diff()
 {
     // dump($sourceDocument);
     // Source = 3 ; target = 2
     $sourceData = json_decode($source->content);
     $targetData = json_decode($target->content);
     $diff = array();
     $diff['title'] = html_diff($sourceData->title, $targetData->title, true);
     $diff['permalink'] = html_diff($sourceData->permalink, $targetData->permalink, true);
     $diff['intro'] = html_diff($sourceData->intro, $targetData->intro);
     // $diff['state']	=	html_diff($sourceData->state,$targetData->state, true);
     // TODO: get category title
     $sourceCategory = EB::table('Category');
     $sourceCategory->load($sourceData->category_id);
     $diff['source_category_title'] = $sourceCategory->title;
     $targetCategory = EB::table('Category');
     $targetCategory->load($targetData->category_id);
     $diff['diff_category_title'] = $targetCategory->title;
     return $diff;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:20,代码来源:revisions.php


示例4: tpl_content_core

/**
 * Default Action of TPL_ACT_RENDER
 *
 * @return bool
 */
function tpl_content_core()
{
    global $ACT;
    global $TEXT;
    global $PRE;
    global $SUF;
    global $SUM;
    global $IDX;
    global $INPUT;
    switch ($ACT) {
        case 'show':
            html_show();
            break;
            /** @noinspection PhpMissingBreakStatementInspection */
        /** @noinspection PhpMissingBreakStatementInspection */
        case 'locked':
            html_locked();
        case 'edit':
        case 'recover':
            html_edit();
            break;
        case 'preview':
            html_edit();
            html_show($TEXT);
            break;
        case 'draft':
            html_draft();
            break;
        case 'search':
            html_search();
            break;
        case 'revisions':
            html_revisions($INPUT->int('first'));
            break;
        case 'diff':
            html_diff();
            break;
        case 'recent':
            html_recent($INPUT->extract('first')->int('first'), $INPUT->str('show_changes'));
            break;
        case 'index':
            html_index($IDX);
            #FIXME can this be pulled from globals? is it sanitized correctly?
            break;
        case 'backlink':
            html_backlinks();
            break;
        case 'conflict':
            html_conflict(con($PRE, $TEXT, $SUF), $SUM);
            html_diff(con($PRE, $TEXT, $SUF), false);
            break;
        case 'login':
            html_login();
            break;
        case 'register':
            html_register();
            break;
        case 'resendpwd':
            html_resendpwd();
            break;
        case 'denied':
            print p_locale_xhtml('denied');
            break;
        case 'profile':
            html_updateprofile();
            break;
        case 'admin':
            tpl_admin();
            break;
        case 'subscribe':
            tpl_subscribe();
            break;
        case 'media':
            tpl_media();
            break;
        default:
            $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT);
            if ($evt->advise_before()) {
                msg("Failed to handle command: " . hsc($ACT), -1);
            }
            $evt->advise_after();
            unset($evt);
            return false;
    }
    return true;
}
开发者ID:neosunchess,项目名称:dokuwiki,代码行数:91,代码来源:template.php


示例5: tpl_content_core

function tpl_content_core()
{
    global $ACT;
    global $TEXT;
    global $PRE;
    global $SUF;
    global $SUM;
    global $IDX;
    switch ($ACT) {
        case 'show':
            html_show();
            break;
        case 'locked':
            html_locked();
        case 'edit':
        case 'recover':
            html_edit();
            break;
        case 'preview':
            html_edit();
            html_show($TEXT);
            break;
        case 'draft':
            html_draft();
            break;
        case 'search':
            html_search();
            break;
        case 'revisions':
            $first = isset($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
            html_revisions($first);
            break;
        case 'diff':
            html_diff();
            break;
        case 'recent':
            if (is_array($_REQUEST['first'])) {
                $_REQUEST['first'] = array_keys($_REQUEST['first']);
                $_REQUEST['first'] = $_REQUEST['first'][0];
            }
            $first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
            html_recent($first);
            break;
        case 'index':
            html_index($IDX);
            #FIXME can this be pulled from globals? is it sanitized correctly?
            break;
        case 'backlink':
            html_backlinks();
            break;
        case 'conflict':
            html_conflict(con($PRE, $TEXT, $SUF), $SUM);
            html_diff(con($PRE, $TEXT, $SUF), false);
            break;
        case 'login':
            html_login();
            break;
        case 'register':
            html_register();
            break;
        case 'resendpwd':
            html_resendpwd();
            break;
        case 'denied':
            print p_locale_xhtml('denied');
            break;
        case 'profile':
            html_updateprofile();
            break;
        case 'admin':
            tpl_admin();
            break;
        case 'subscribe':
            tpl_subscribe();
            break;
        default:
            $evt = new Doku_Event('TPL_ACT_UNKNOWN', $ACT);
            if ($evt->advise_before()) {
                msg("Failed to handle command: " . hsc($ACT), -1);
            }
            $evt->advise_after();
            unset($evt);
            return false;
    }
    return true;
}
开发者ID:highpictv,项目名称:wiki,代码行数:86,代码来源:template.php


示例6: html_diff

be added after it.

This paragraph contains
important new additions
to this document.';
echo '
<style type="text/css">
.ins { background: #cfc; }
.del { background: #fcc; }
ins { background: #9f9; }
del { background: #f99; }
hr { background: none; border: none; border-top: 2px dotted #000; color: #fff; }
</style>
<pre>
';
echo html_diff($original, $updated);
function html_diff($old, $new)
{
    $diff = simpleDiff::diff_to_array(false, $old, $new, 1);
    $out = '<table class="diff">';
    $prev = key($diff);
    foreach ($diff as $i => $line) {
        if ($i > $prev + 1) {
            $out .= '<tr><td colspan="5" class="separator"><hr /></td></tr>';
        }
        list($type, $old, $new) = $line;
        $class1 = $class2 = '';
        $t1 = $t2 = '';
        if ($type == simpleDiff::INS) {
            $class2 = 'ins';
            $t2 = '+';
开发者ID:rocketeerbkw,项目名称:gistpad,代码行数:31,代码来源:example.php


示例7: ws_display


//.........这里部分代码省略.........
                        <td>
                            <a title="View host. ID: {$old_host['id']}"
                               class="nav"
                               onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'display_host\\', \\'host_id=>{$old_host['id']}\\', \\'display\\')');"
                            >{$old_host['name']}</a
                            >.<a title="View domain. ID: {$old_host['domain_id']}"
                                 class="domain"
                                 onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'display_domain\\', \\'domain_id=>{$old_host['domain_id']}\\', \\'display\\')');"
                            >{$old_host['domain_fqdn']}</a>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Insert date:</td>
                        <td>{$old['ctime']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Config type:</td>
                        <td>{$old['config_type_name']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">MD5:</td>
                        <td>{$old['md5_checksum']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Actions:</td>
                        <td>
                            <a title="View config"
                               class="nav"
                               onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'{$window_name}\\', \\'host_id=>{$old_host['id']},displayconf=>{$old['id']}\\', \\'display\\')');"
                            ><img src="{$images}/silk/zoom.png" alt="View config" border="0"></a>&nbsp;

                            <a title="Download config" class="act" target="null" href="{$baseURL}/config_dnld.php?config_id={$old['id']}&download=1"
                            ><img src="{$images}/silk/disk.png" alt="Download config" border="0"></a>&nbsp;
                        </td>
                    </tr>
                </table>
            </td>
            <td align="left" style="background-color: {$color['bar_bg']};">
                <table cellspacing="0" border="0" cellpadding="2" align="left" style="font-size:small;">
                    <tr>
                        <td style="font-weight: bold;">Host:</td>
                        <td>
                            <a title="View host. ID: {$new_host['id']}"
                               class="nav"
                               onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'display_host\\', \\'host_id=>{$new_host['id']}\\', \\'display\\')');"
                            >{$new_host['name']}</a
                            >.<a title="View domain. ID: {$new_host['domain_id']}"
                                 class="domain"
                                 onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'display_domain\\', \\'domain_id=>{$new_host['domain_id']}\\', \\'display\\')');"
                            >{$new_host['domain_fqdn']}</a>
                        </td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Insert date:</td>
                        <td>{$new['ctime']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Config type:</td>
                        <td>{$new['config_type_name']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">MD5:</td>
                        <td>{$new['md5_checksum']}</td>
                    </tr>
                    <tr>
                        <td style="font-weight: bold;">Actions:</td>
                        <td>
                            <a title="View config"
                               class="nav"
                               onClick="xajax_window_submit('work_space', 'xajax_window_submit(\\'{$window_name}\\', \\'host_id=>{$new_host['id']},displayconf=>{$new['id']}\\', \\'display\\')');"
                            ><img src="{$images}/silk/zoom.png" alt="View config" border="0"></a>&nbsp;

                            <a title="Download config" class="act" target="null" href="{$baseURL}/config_dnld.php?config_id={$new['id']}&download=1"
                            ><img src="{$images}/silk/disk.png" alt="Download config" border="0"></a>&nbsp;
                        </td>
                    </tr>
                </table>
            </td>
            </tr>
            <tr>
            <td colspan="2">
EOL;
        // Display the diff
        $html .= html_diff(html_entity_decode($old['config_body'], ENT_QUOTES, $conf['php_charset']), html_entity_decode($new['config_body'], ENT_QUOTES, $conf['php_charset']), "Config A", "Config B", 0);
        $html .= <<<EOL
            </td>
            </tr>
            </table>
        </div>
EOL;
    }
    // Insert the new html into the window
    // Instantiate the xajaxResponse object
    $response = new xajaxResponse();
    $response->addAssign("work_space_content", "innerHTML", $html);
    if ($js) {
        $response->addScript($js);
    }
    return $response->getXML();
}
开发者ID:edt82,项目名称:ona,代码行数:101,代码来源:display_config_text.inc.php


示例8: diff

 /**
  * Displays a comparison of two versions for the blog post
  *
  * @since	4.0
  * @access	public
  * @param	string
  * @return
  */
 public function diff()
 {
     require JPATH_ADMINISTRATOR . '/components/com_easyblog/includes/htmldiff/html_diff.php';
     // Only allow logged in users on this page
     EB::requireLogin();
     //Get revision table
     $Revision = EB::table('Revision');
     // get blogid
     $versionId = JRequest::getVar('id', '');
     $postId = JRequest::getVar('post_id', '');
     //Load the version for the blog post
     $currentBlog = $Revision->getCurrentBlog($postId);
     $compareBlog = $Revision->getCompareBlog($versionId);
     $currentData = json_decode($currentBlog->params);
     $compareData = json_decode($compareBlog->params);
     $diff = html_diff($currentData->intro, $compareData->intro, true);
     // Get category title
     $category = EB::table('Category');
     $category->load($currentData->category_id);
     $dataArr = array();
     $dataArr['catOld'] = $category->title;
     $category->load($compareData->category_id);
     $dataArr['catNew'] = $category->title;
     $this->set('currentData', $currentData);
     $this->set('compareData', $compareData);
     $this->set('dataArr', $dataArr);
     $this->set('diff', $diff);
     $this->set('blogId', $postId);
     $this->set('versionId', $versionId);
     echo parent::display('dashboard/version/compare');
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:39,代码来源:view.html.php


示例9: write_rss2

        write_rss2();
    } elseif (in_array($_GET['dl'], $arrowdesc, true)) {
        draw_arrow($_GET['dl']);
    }
}
html_header();
html_style();
html_breadcrumbs();
html_pages();
if (isset($_GET['p'])) {
    html_spacer();
    html_summary($_GET['p']);
    html_spacer();
    if ($_GET['a'] == "commitdiff") {
        html_title("diff --git {$_GET['p']} {$_GET['h']}");
        html_diff($_GET['p'], $_GET['h']);
    } elseif (isset($_GET['tr'])) {
        html_title("Files");
        html_browse($_GET['p']);
    }
} else {
    html_spacer();
    html_home();
}
html_title("Help");
if (isset($_GET['p'])) {
    html_help($_GET['p']);
} else {
    html_help("projectname.git ");
}
html_footer();
开发者ID:rwaldron,项目名称:git-php,代码行数:31,代码来源:git.php


示例10: git_render_page

function git_render_page()
{
    global $git_embed, $repos;
    $git_embed = true;
    /* Add the default css */
    $git_css = true;
    /* Add the git logo in the footer */
    $git_logo = true;
    $title = "git";
    $repo_index = "index.aux";
    $repo_directory = '/home/david/git/';
    $geshi_directory = '/home/david/src/mediawiki/extensions/SyntaxHighlight_GeSHi/geshi';
    //if git is not installed into standard path, we need to set the path
    $mypath = getenv("PATH");
    $addpath = "/usr/lib/git-core";
    if (isset($mypath)) {
        $mypath .= ":{$addpath}";
    } else {
        $mypath = $addpath;
    }
    putenv("PATH={$mypath}");
    //repos could be made by an embeder script
    if (!is_array($repos)) {
        $repos = array();
    }
    if (file_exists($repo_index)) {
        $r = file($repo_index);
        foreach ($r as $repo) {
            $repos[] = trim($repo);
        }
    } else {
        if (file_exists($repo_directory) && is_dir($repo_directory)) {
            if ($handle = opendir($repo_directory)) {
                while (false !== ($file = readdir($handle))) {
                    if ($file != "." && $file != "..") {
                        /* TODO: Check for valid git repos */
                        $repos[] = trim($repo_directory . $file);
                    }
                }
                closedir($handle);
            }
        }
    }
    sort($repos);
    if ($geshi_directory != '') {
        require "{$geshi_directory}/geshi.php";
    }
    if (!isset($git_embed) && $git_embed != true) {
        $git_embed = false;
    }
    foreach ($_GET as $var => $val) {
        $_GET[$var] = str_replace(";", "", $_GET[$var]);
    }
    $str = '';
    if (isset($_GET['dl'])) {
        if ($_GET['dl'] == 'targz') {
            write_targz(get_repo_path($_GET['p']));
        } else {
            if ($_GET['dl'] == 'zip') {
                write_zip(get_repo_path($_GET['p']));
            } else {
                if ($_GET['dl'] == 'git_logo') {
                    write_git_logo();
                } else {
                    if ($_GET['dl'] == 'plain') {
                        write_plain();
                    } else {
                        if ($_GET['dl'] == 'rss2') {
                            write_rss2();
                        }
                    }
                }
            }
        }
    }
    $str .= html_header($title);
    $str .= html_style($git_css);
    $str .= html_breadcrumbs();
    if (isset($_GET['p'])) {
        $str .= html_spacer();
        $str .= html_desc($_GET['p']);
        $str .= html_spacer();
        $str .= html_summary($_GET['p']);
        $str .= html_spacer();
        if ($_GET['a'] == "commitdiff") {
            $str .= html_diff($_GET['p'], $_GET['c'], $_GET['cp']);
        } else {
            $str .= html_browse($_GET['p']);
        }
    } else {
        $str .= html_spacer();
        $str .= html_home($repos);
    }
    $str .= html_footer($git_logo);
    return $str;
}
开发者ID:eclecticdave,项目名称:gitbrowser,代码行数:96,代码来源:GitBrowser.php


示例11: foreach

                    $curRev = $index;
                    break;
                }
            }
        }
        // Get the source for the active revision
        foreach ($revisions[$curRev]['files'] as $file => $url) {
            $gistSource[$file]['cur'] = curl($url);
            // Get the source for the previous revision (for diffing)
            $gistSource[$file]['prev'] = '';
            if ($curRev < count($revisions) - 1) {
                $gistSource[$file]['prev'] = curl($revisions[$curRev + 1]['files'][$file]);
            }
            // Diff the two
            $diff = simpleDiff::diff($gistSource[$file]['prev'], $gistSource[$file]['cur']);
            $gistSource[$file]['diff'] = html_diff($gistSource[$file]['prev'], $gistSource[$file]['cur']);
        }
        //print_r($gistSource);
        //echo '<pre>' . print_r($gistSource, true) . '</pre>';
    }
}
// Make sure there is no whitespace before first HTML code
// so we don't trigger Quirks mode
?>
<!DOCTYPE html>
<html>
  <head>
    <title>GistPad</title>
    
    <!--
    Copyright (c) 2010 Brandon Williams
开发者ID:rocketeerbkw,项目名称:gistpad,代码行数:31,代码来源:index.php



注:本文中的html_diff函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP html_diff_head函数代码示例发布时间:2022-05-15
下一篇:
PHP html_decode函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap