Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15390284
D13157.id31795.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D13157.id31795.diff
View Options
diff --git a/src/applications/diviner/controller/DivinerAtomController.php b/src/applications/diviner/controller/DivinerAtomController.php
--- a/src/applications/diviner/controller/DivinerAtomController.php
+++ b/src/applications/diviner/controller/DivinerAtomController.php
@@ -47,6 +47,8 @@
->withNames(array($this->atomName))
->withContexts(array($this->atomContext))
->withIndexes(array($this->atomIndex))
+ ->withExcludeGhosts(true)
+ ->withExcludeUndocumentable(true)
->needAtoms(true)
->needExtends(true)
->needChildren(true)
diff --git a/src/applications/diviner/controller/DivinerBookController.php b/src/applications/diviner/controller/DivinerBookController.php
--- a/src/applications/diviner/controller/DivinerBookController.php
+++ b/src/applications/diviner/controller/DivinerBookController.php
@@ -46,6 +46,8 @@
$atoms = id(new DivinerAtomQuery())
->setViewer($viewer)
->withBookPHIDs(array($book->getPHID()))
+ ->withExcludeGhosts(true)
+ ->withExcludeUndocumentable(true)
->execute();
$atoms = msort($atoms, 'getSortKey');
diff --git a/src/applications/diviner/controller/DivinerFindController.php b/src/applications/diviner/controller/DivinerFindController.php
--- a/src/applications/diviner/controller/DivinerFindController.php
+++ b/src/applications/diviner/controller/DivinerFindController.php
@@ -41,6 +41,9 @@
$query->withTypes(array($type));
}
+ $query->withExcludeGhosts(true);
+ $query->withExcludeUndocumentable(true);
+
$name_query = clone $query;
$name_query->withNames(
diff --git a/src/applications/diviner/publisher/DivinerLivePublisher.php b/src/applications/diviner/publisher/DivinerLivePublisher.php
--- a/src/applications/diviner/publisher/DivinerLivePublisher.php
+++ b/src/applications/diviner/publisher/DivinerLivePublisher.php
@@ -64,7 +64,7 @@
$symbols = id(new DivinerAtomQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withBookPHIDs(array($this->loadBook()->getPHID()))
- ->withIncludeUndocumentable(true)
+ ->withExcludeGhosts(true)
->execute();
return mpull($symbols, 'getGraphHash');
diff --git a/src/applications/diviner/query/DivinerAtomQuery.php b/src/applications/diviner/query/DivinerAtomQuery.php
--- a/src/applications/diviner/query/DivinerAtomQuery.php
+++ b/src/applications/diviner/query/DivinerAtomQuery.php
@@ -9,8 +9,8 @@
private $types;
private $contexts;
private $indexes;
- private $includeUndocumentable;
- private $includeGhosts;
+ private $excludeUndocumentable;
+ private $excludeGhosts;
private $nodeHashes;
private $titles;
private $nameContains;
@@ -81,7 +81,7 @@
/**
- * Include "ghosts", which are symbols which used to exist but do not exist
+ * Exclude "ghosts", which are symbols which used to exist but do not exist
* currently (for example, a function which existed in an older version of
* the codebase but was deleted).
*
@@ -92,14 +92,11 @@
* have been generated incorrectly by accident. In these cases, we can
* restore the original data.
*
- * However, most callers are not interested in these symbols, so they are
- * excluded by default. You can use this method to include them in results.
- *
- * @param bool True to include ghosts.
+ * @param bool True to exclude ghosts.
* @return this
*/
- public function withIncludeGhosts($include) {
- $this->includeGhosts = $include;
+ public function withExcludeGhosts($exclude) {
+ $this->excludeGhosts = $exclude;
return $this;
}
@@ -108,8 +105,8 @@
return $this;
}
- public function withIncludeUndocumentable($include) {
- $this->includeUndocumentable = $include;
+ public function withExcludeUndocumentable($exclude) {
+ $this->excludeUndocumentable = $exclude;
return $this;
}
@@ -346,13 +343,13 @@
$this->indexes);
}
- if (!$this->includeUndocumentable) {
+ if ($this->excludeUndocumentable) {
$where[] = qsprintf(
$conn_r,
'isDocumentable = 1');
}
- if (!$this->includeGhosts) {
+ if ($this->excludeGhosts) {
$where[] = qsprintf(
$conn_r,
'graphHash IS NOT NULL');
diff --git a/src/applications/diviner/storage/DivinerLiveBook.php b/src/applications/diviner/storage/DivinerLiveBook.php
--- a/src/applications/diviner/storage/DivinerLiveBook.php
+++ b/src/applications/diviner/storage/DivinerLiveBook.php
@@ -93,8 +93,6 @@
$atoms = id(new DivinerAtomQuery())
->setViewer($engine->getViewer())
->withBookPHIDs(array($this->getPHID()))
- ->withIncludeGhosts(true)
- ->withIncludeUndocumentable(true)
->execute();
foreach ($atoms as $atom) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 6:05 AM (6 d, 15 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7386728
Default Alt Text
D13157.id31795.diff (4 KB)
Attached To
Mode
D13157: Invert include/exclude logic on DivinerAtomQuery
Attached
Detach File
Event Timeline
Log In to Comment