本文整理汇总了PHP中Diff::closing方法的典型用法代码示例。如果您正苦于以下问题:PHP Diff::closing方法的具体用法?PHP Diff::closing怎么用?PHP Diff::closing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Diff
的用法示例。
在下文中一共展示了Diff::closing方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: handle
public function handle()
{
global $ID;
global $INPUT;
$this->file = Projects_file::file($ID);
$old_text = $INPUT->post->str($this->old_input_name(), '');
$old = $this->split($old_text);
$new_text = $INPUT->post->str($this->new_input_name(), '');
$new = $this->split($new_text);
$diff = new Diff($old, $new);
$now = $this->now();
if ($new == $now) {
return "show";
}
if ($old != $now) {
$check = new Diff($old, $now);
$merged = merge3($diff->edits, $check->edits);
if ($merged['conflict']) {
global $MERGED_DIFF;
$MERGED_DIFF = $merged['merged'];
return $this->action();
}
$diff->edits = $merged['merged'];
$new = $diff->closing();
}
lock($ID);
$text = $this->update($this->merge($new));
if ($text === FALSE) {
msg('file has been changed, cannot save!', -1);
} else {
saveWikiText($ID, $text, "");
}
unlock($ID);
return "show";
}