Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F111486939
PhabricatorApplicationTransactionTextDiffDetailView.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, May 2, 14:21
Size
1 KB
Mime Type
text/x-php
Expires
Sun, May 4, 14:21 (2 d)
Engine
blob
Format
Raw Data
Handle
25927920
Attached To
rPH Phabricator
PhabricatorApplicationTransactionTextDiffDetailView.php
View Options
<?php
final
class
PhabricatorApplicationTransactionTextDiffDetailView
extends
AphrontView
{
private
$oldText
;
private
$newText
;
public
function
setNewText
(
$new_text
)
{
$this
->
newText
=
$new_text
;
return
$this
;
}
public
function
setOldText
(
$old_text
)
{
$this
->
oldText
=
$old_text
;
return
$this
;
}
public
function
render
()
{
$old
=
$this
->
oldText
;
$new
=
$this
->
newText
;
// TODO: On mobile, or perhaps by default, we should switch to 1-up once
// that is built.
$old
=
phutil_utf8_hard_wrap
(
$old
,
80
);
$old
=
implode
(
"
\n
"
,
$old
);
$new
=
phutil_utf8_hard_wrap
(
$new
,
80
);
$new
=
implode
(
"
\n
"
,
$new
);
$engine
=
new
PhabricatorDifferenceEngine
();
$changeset
=
$engine
->
generateChangesetFromFileContent
(
$old
,
$new
);
$whitespace_mode
=
DifferentialChangesetParser
::
WHITESPACE_SHOW_ALL
;
$parser
=
new
DifferentialChangesetParser
();
$parser
->
setChangeset
(
$changeset
);
$parser
->
setMarkupEngine
(
new
PhabricatorMarkupEngine
());
$parser
->
setWhitespaceMode
(
$whitespace_mode
);
return
$parser
->
render
(
0
,
PHP_INT_MAX
,
array
());
}
}
Event Timeline
Log In to Comment