Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2893173
PhabricatorFileTransform.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
PhabricatorFileTransform.php
View Options
<?php
abstract
class
PhabricatorFileTransform
extends
Phobject
{
abstract
public
function
getTransformName
(
)
;
abstract
public
function
getTransformKey
(
)
;
abstract
public
function
canApplyTransform
(
PhabricatorFile
$file
)
;
abstract
public
function
applyTransform
(
PhabricatorFile
$file
)
;
public
function
getDefaultTransform
(
PhabricatorFile
$file
)
{
return
null
;
}
public
function
generateTransforms
(
)
{
return
array
(
$this
)
;
}
public
static
function
getAllTransforms
(
)
{
static
$map
;
if
(
$map
===
null
)
{
$xforms
=
id
(
new
PhutilSymbolLoader
(
)
)
->
setAncestorClass
(
__CLASS__
)
->
loadObjects
(
)
;
$result
=
array
(
)
;
foreach
(
$xforms
as
$xform_template
)
{
foreach
(
$xform_template
->
generateTransforms
(
)
as
$xform
)
{
$key
=
$xform
->
getTransformKey
(
)
;
if
(
isset
(
$result
[
$key
]
)
)
{
throw
new
Exception
(
pht
(
'Two %s objects define the same transform key ("%s"), but '
.
'each transform must have a unique key.'
,
__CLASS__
,
$key
)
)
;
}
$result
[
$key
]
=
$xform
;
}
}
$map
=
$result
;
}
return
$map
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 18:01 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1127205
Default Alt Text
PhabricatorFileTransform.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment