Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894324
PhabricatorTextExportFormat.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorTextExportFormat.php
View Options
<?php
final
class
PhabricatorTextExportFormat
extends
PhabricatorExportFormat
{
const
EXPORTKEY
=
'text'
;
private
$rows
=
array
(
)
;
public
function
getExportFormatName
(
)
{
return
'Tab-Separated Text (.txt)'
;
}
public
function
isExportFormatEnabled
(
)
{
return
true
;
}
public
function
getFileExtension
(
)
{
return
'txt'
;
}
public
function
getMIMEContentType
(
)
{
return
'text/plain'
;
}
public
function
addHeaders
(
array
$fields
)
{
$headers
=
mpull
(
$fields
,
'getLabel'
)
;
$this
->
addRow
(
$headers
)
;
}
public
function
addObject
(
$object
,
array
$fields
,
array
$map
)
{
$values
=
array
(
)
;
foreach
(
$fields
as
$key
=>
$field
)
{
$value
=
$map
[
$key
]
;
$value
=
$field
->
getTextValue
(
$value
)
;
$values
[
]
=
$value
;
}
$this
->
addRow
(
$values
)
;
}
private
function
addRow
(
array
$values
)
{
$row
=
array
(
)
;
foreach
(
$values
as
$value
)
{
if
(
phutil_nonempty_string
(
$value
)
)
{
$row
[
]
=
addcslashes
(
$value
,
"\0..\37\\\177..\377"
)
;
}
}
$this
->
rows
[
]
=
implode
(
"\t"
,
$row
)
;
}
public
function
newFileData
(
)
{
return
implode
(
"\n"
,
$this
->
rows
)
.
"\n"
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 19:43 (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1128099
Default Alt Text
PhabricatorTextExportFormat.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment