Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1469564
PhabricatorTextDocumentEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
731 B
Referenced Files
None
Subscribers
None
PhabricatorTextDocumentEngine.php
View Options
<?php
abstract
class
PhabricatorTextDocumentEngine
extends
PhabricatorDocumentEngine
{
protected
function
canRenderDocumentType
(
PhabricatorDocumentRef
$ref
)
{
return
$ref
->
isProbablyText
();
}
protected
function
newTextDocumentContent
(
$content
)
{
$lines
=
phutil_split_lines
(
$content
);
$view
=
id
(
new
PhabricatorSourceCodeView
())
->
setLines
(
$lines
)
->
disableHighlightOnClick
();
$container
=
phutil_tag
(
'div'
,
array
(
'class'
=>
'document-engine-text'
,
),
$view
);
return
$container
;
}
protected
function
loadTextData
(
PhabricatorDocumentRef
$ref
)
{
$content
=
$ref
->
loadData
();
$content
=
phutil_utf8ize
(
$content
);
return
$content
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Jul 12, 4:46 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
341638
Default Alt Text
PhabricatorTextDocumentEngine.php (731 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment