Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2892819
PhabricatorSearchApplicationStorageEnginePanel.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
2 KB
Referenced Files
None
Subscribers
None
PhabricatorSearchApplicationStorageEnginePanel.php
View Options
<?php
final
class
PhabricatorSearchApplicationStorageEnginePanel
extends
PhabricatorApplicationConfigurationPanel
{
public
function
getPanelKey
(
)
{
return
'search'
;
}
public
function
shouldShowForApplication
(
PhabricatorApplication
$application
)
{
return
$application
instanceof
PhabricatorSearchApplication
;
}
public
function
buildConfigurationPagePanel
(
)
{
$viewer
=
$this
->
getViewer
(
)
;
$application
=
$this
->
getApplication
(
)
;
$services
=
PhabricatorSearchService
::
getAllServices
(
)
;
$rows
=
array
(
)
;
$rowc
=
array
(
)
;
foreach
(
$services
as
$key
=>
$service
)
{
try
{
$name
=
$service
->
getDisplayName
(
)
;
}
catch
(
Exception
$ex
)
{
$name
=
phutil_tag
(
'em'
,
array
(
)
,
pht
(
'Error'
)
)
;
}
try
{
$can_read
=
$service
->
isReadable
(
)
?
pht
(
'Yes'
)
:
pht
(
'No'
)
;
}
catch
(
Exception
$ex
)
{
$can_read
=
pht
(
'N/A'
)
;
}
try
{
$can_write
=
$service
->
isWritable
(
)
?
pht
(
'Yes'
)
:
pht
(
'No'
)
;
}
catch
(
Exception
$ex
)
{
$can_write
=
pht
(
'N/A'
)
;
}
$rows
[
]
=
array
(
$name
,
$can_read
,
$can_write
,
)
;
}
$instructions
=
pht
(
'To configure the search engines, edit [[ %s | %s ]] configuration. '
.
'See **[[ %s | %s ]]** for documentation.'
,
'/config/edit/cluster.search/'
,
'cluster.search'
,
PhabricatorEnv
::
getDoclink
(
'Cluster: Search'
)
,
pht
(
'Cluster: Search'
)
)
;
$table
=
id
(
new
AphrontTableView
(
$rows
)
)
->
setNoDataString
(
pht
(
'No search engines available.'
)
)
->
setNotice
(
new
PHUIRemarkupView
(
$viewer
,
$instructions
)
)
->
setHeaders
(
array
(
pht
(
'Engine Name'
)
,
pht
(
'Writable'
)
,
pht
(
'Readable'
)
,
)
)
->
setRowClasses
(
$rowc
)
->
setColumnClasses
(
array
(
'wide'
,
''
,
''
,
)
)
;
$box
=
id
(
new
PHUIObjectBoxView
(
)
)
->
setHeaderText
(
pht
(
'Search 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
Sun, Jan 19, 17:24 (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1126929
Default Alt Text
PhabricatorSearchApplicationStorageEnginePanel.php (2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment