Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/applications/search/management/PhabricatorSearchManagementQueryWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementQueryWorkflow.php
index 8e40162a98..c4077e5266 100644
--- a/src/applications/search/management/PhabricatorSearchManagementQueryWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementQueryWorkflow.php
@@ -1,55 +1,55 @@
<?php
final class PhabricatorSearchManagementQueryWorkflow
extends PhabricatorSearchManagementWorkflow {
protected function didConstruct() {
$this
->setName('query')
->setSynopsis(
pht('Run a search query. Intended for debugging and development.'))
->setArguments(
array(
array(
'name' => 'query',
'param' => 'query',
'help' => pht('Raw query to execute.'),
),
));
}
public function execute(PhutilArgumentParser $args) {
$viewer = $this->getViewer();
$raw_query = $args->getArg('query');
- if (!strlen($raw_query)) {
+ if (!phutil_nonempty_string($raw_query)) {
throw new PhutilArgumentUsageException(
pht('Specify a query with --query.'));
}
$engine = id(new PhabricatorSearchApplicationSearchEngine())
->setViewer($viewer);
$saved = $engine->newSavedQuery();
$saved->setParameter('query', $raw_query);
$query = $engine->buildQueryFromSavedQuery($saved);
$pager = $engine->newPagerForSavedQuery($saved);
$results = $engine->executeQuery($query, $pager);
if ($results) {
foreach ($results as $result) {
echo tsprintf(
"%s\t%s\n",
$result->getPHID(),
$result->getName());
}
} else {
echo tsprintf(
"%s\n",
pht('No results.'));
}
return 0;
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 4:01 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1176
Default Alt Text
(1 KB)

Event Timeline