Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93837158
PhabricatorSearchApplicationStorageEnginePanel.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Dec 1, 21:58
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Dec 3, 21:58 (2 d)
Engine
blob
Format
Raw Data
Handle
22712664
Attached To
rPH Phabricator
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
();
$active_engine
=
PhabricatorSearchEngine
::
loadEngine
();
$engines
=
PhabricatorSearchEngine
::
loadAllEngines
();
$rows
=
array
();
$rowc
=
array
();
foreach
(
$engines
as
$key
=>
$engine
)
{
try
{
$index_exists
=
$engine
->
indexExists
()
?
pht
(
'Yes'
)
:
pht
(
'No'
);
}
catch
(
Exception
$ex
)
{
$index_exists
=
pht
(
'N/A'
);
}
try
{
$index_is_sane
=
$engine
->
indexIsSane
()
?
pht
(
'Yes'
)
:
pht
(
'No'
);
}
catch
(
Exception
$ex
)
{
$index_is_sane
=
pht
(
'N/A'
);
}
if
(
$engine
==
$active_engine
)
{
$rowc
[]
=
'highlighted'
;
}
else
{
$rowc
[]
=
null
;
}
$rows
[]
=
array
(
$key
,
get_class
(
$engine
),
$index_exists
,
$index_is_sane
,
);
}
$table
=
id
(
new
AphrontTableView
(
$rows
))
->
setNoDataString
(
pht
(
'No search engines available.'
))
->
setHeaders
(
array
(
pht
(
'Key'
),
pht
(
'Class'
),
pht
(
'Index Exists'
),
pht
(
'Index Is Sane'
),
))
->
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
();
}
}
Event Timeline
Log In to Comment