Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F460723
PhabricatorFilesApplicationStorageEnginePanel.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
PhabricatorFilesApplicationStorageEnginePanel.php
View Options
<?php
final
class
PhabricatorFilesApplicationStorageEnginePanel
extends
PhabricatorApplicationConfigurationPanel
{
public
function
getPanelKey
()
{
return
'storage'
;
}
public
function
shouldShowForApplication
(
PhabricatorApplication
$application
)
{
return
(
$application
instanceof
PhabricatorFilesApplication
);
}
public
function
buildConfigurationPagePanel
()
{
$viewer
=
$this
->
getViewer
();
$application
=
$this
->
getApplication
();
$engines
=
PhabricatorFileStorageEngine
::
loadAllEngines
();
$writable_engines
=
PhabricatorFileStorageEngine
::
loadWritableEngines
();
$chunk_engines
=
PhabricatorFileStorageEngine
::
loadWritableChunkEngines
();
$yes
=
pht
(
'Yes'
);
$no
=
pht
(
'No'
);
$rows
=
array
();
$rowc
=
array
();
foreach
(
$engines
as
$key
=>
$engine
)
{
$limited
=
$no
;
$limit
=
null
;
if
(
$engine
->
hasFilesizeLimit
())
{
$limited
=
$yes
;
$limit
=
phutil_format_bytes
(
$engine
->
getFilesizeLimit
());
}
if
(
$engine
->
canWriteFiles
())
{
$writable
=
$yes
;
}
else
{
$writable
=
$no
;
}
if
(
$engine
->
isTestEngine
())
{
$test
=
$yes
;
}
else
{
$test
=
$no
;
}
if
(
isset
(
$writable_engines
[
$key
])
||
isset
(
$chunk_engines
[
$key
]))
{
$rowc
[]
=
'highlighted'
;
}
else
{
$rowc
[]
=
null
;
}
$rows
[]
=
array
(
$key
,
get_class
(
$engine
),
$test
,
$writable
,
$limited
,
$limit
,
);
}
$table
=
id
(
new
AphrontTableView
(
$rows
))
->
setNoDataString
(
pht
(
'No storage engines available.'
))
->
setHeaders
(
array
(
pht
(
'Key'
),
pht
(
'Class'
),
pht
(
'Unit Test'
),
pht
(
'Writable'
),
pht
(
'Has Limit'
),
pht
(
'Limit'
),
))
->
setRowClasses
(
$rowc
)
->
setColumnClasses
(
array
(
''
,
'wide'
,
''
,
''
,
''
,
'n'
,
));
$box
=
id
(
new
PHUIObjectBoxView
())
->
setHeaderText
(
pht
(
'Storage Engines'
))
->
appendChild
(
$table
);
return
$box
;
}
public
function
handlePanelRequest
(
AphrontRequest
$request
,
PhabricatorController
$controller
)
{
return
new
Aphront404Response
();
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 5, 4:02 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
72178
Default Alt Text
PhabricatorFilesApplicationStorageEnginePanel.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment