Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93603263
PhabricatorSearchManagementInitWorkflow.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
Sat, Nov 30, 02:23
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 02:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22674320
Attached To
rPH Phabricator
PhabricatorSearchManagementInitWorkflow.php
View Options
<?php
final
class
PhabricatorSearchManagementInitWorkflow
extends
PhabricatorSearchManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'init'
)
->
setSynopsis
(
pht
(
'Initialize or repair an index.'
))
->
setExamples
(
'**init**'
);
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$console
=
PhutilConsole
::
getConsole
();
$engine
=
PhabricatorFulltextStorageEngine
::
loadEngine
();
$work_done
=
false
;
if
(!
$engine
->
indexExists
())
{
$console
->
writeOut
(
'%s'
,
pht
(
'Index does not exist, creating...'
));
$engine
->
initIndex
();
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'done.'
));
$work_done
=
true
;
}
else
if
(!
$engine
->
indexIsSane
())
{
$console
->
writeOut
(
'%s'
,
pht
(
'Index exists but is incorrect, fixing...'
));
$engine
->
initIndex
();
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'done.'
));
$work_done
=
true
;
}
if
(
$work_done
)
{
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'Index maintenance complete. Run `%s` to reindex documents'
,
'./bin/search index'
));
}
else
{
$console
->
writeOut
(
"%s
\n
"
,
pht
(
'Nothing to do.'
));
}
}
}
Event Timeline
Log In to Comment