Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101182781
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
Thu, Feb 6, 13:44
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Feb 8, 13:44 (2 d)
Engine
blob
Format
Raw Data
Handle
24108500
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
=
PhabricatorFulltextStorageEngine
::
loadEngine
();
$engines
=
PhabricatorFulltextStorageEngine
::
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