Page MenuHomePhabricator

D18556.id44592.diff
No OneTemporary

D18556.id44592.diff

diff --git a/resources/sql/autopatches/20170907.ferret.07.passphrase.doc.sql b/resources/sql/autopatches/20170907.ferret.07.passphrase.doc.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.07.passphrase.doc.sql
@@ -0,0 +1,9 @@
+CREATE TABLE {$NAMESPACE}_passphrase.passphrase_credential_fdocument (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ objectPHID VARBINARY(64) NOT NULL,
+ isClosed BOOL NOT NULL,
+ authorPHID VARBINARY(64),
+ ownerPHID VARBINARY(64),
+ epochCreated INT UNSIGNED NOT NULL,
+ epochModified INT UNSIGNED NOT NULL
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.08.passphrase.field.sql b/resources/sql/autopatches/20170907.ferret.08.passphrase.field.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.08.passphrase.field.sql
@@ -0,0 +1,8 @@
+CREATE TABLE {$NAMESPACE}_passphrase.passphrase_credential_ffield (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ fieldKey VARCHAR(4) NOT NULL COLLATE {$COLLATE_TEXT},
+ rawCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ termCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT},
+ normalCorpus LONGTEXT NOT NULL COLLATE {$COLLATE_SORT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/resources/sql/autopatches/20170907.ferret.09.passphrase.ngrams.sql b/resources/sql/autopatches/20170907.ferret.09.passphrase.ngrams.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20170907.ferret.09.passphrase.ngrams.sql
@@ -0,0 +1,5 @@
+CREATE TABLE {$NAMESPACE}_passphrase.passphrase_credential_fngrams (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
+ documentID INT UNSIGNED NOT NULL,
+ ngram CHAR(3) NOT NULL COLLATE {$COLLATE_TEXT}
+) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1840,6 +1840,10 @@
'PassphraseCredentialDestroyController' => 'applications/passphrase/controller/PassphraseCredentialDestroyController.php',
'PassphraseCredentialDestroyTransaction' => 'applications/passphrase/xaction/PassphraseCredentialDestroyTransaction.php',
'PassphraseCredentialEditController' => 'applications/passphrase/controller/PassphraseCredentialEditController.php',
+ 'PassphraseCredentialFerretDocument' => 'applications/passphrase/storage/PassphraseCredentialFerretDocument.php',
+ 'PassphraseCredentialFerretEngine' => 'applications/passphrase/search/PassphraseCredentialFerretEngine.php',
+ 'PassphraseCredentialFerretField' => 'applications/passphrase/storage/PassphraseCredentialFerretField.php',
+ 'PassphraseCredentialFerretNgrams' => 'applications/passphrase/storage/PassphraseCredentialFerretNgrams.php',
'PassphraseCredentialFulltextEngine' => 'applications/passphrase/search/PassphraseCredentialFulltextEngine.php',
'PassphraseCredentialListController' => 'applications/passphrase/controller/PassphraseCredentialListController.php',
'PassphraseCredentialLockController' => 'applications/passphrase/controller/PassphraseCredentialLockController.php',
@@ -7034,6 +7038,7 @@
'PhabricatorDestructibleInterface',
'PhabricatorSpacesInterface',
'PhabricatorFulltextInterface',
+ 'PhabricatorFerretInterface',
),
'PassphraseCredentialAuthorPolicyRule' => 'PhabricatorPolicyRule',
'PassphraseCredentialConduitController' => 'PassphraseController',
@@ -7044,6 +7049,10 @@
'PassphraseCredentialDestroyController' => 'PassphraseController',
'PassphraseCredentialDestroyTransaction' => 'PassphraseCredentialTransactionType',
'PassphraseCredentialEditController' => 'PassphraseController',
+ 'PassphraseCredentialFerretDocument' => 'PhabricatorFerretDocument',
+ 'PassphraseCredentialFerretEngine' => 'PhabricatorFerretEngine',
+ 'PassphraseCredentialFerretField' => 'PhabricatorFerretField',
+ 'PassphraseCredentialFerretNgrams' => 'PhabricatorFerretNgrams',
'PassphraseCredentialFulltextEngine' => 'PhabricatorFulltextEngine',
'PassphraseCredentialListController' => 'PassphraseController',
'PassphraseCredentialLockController' => 'PassphraseController',
diff --git a/src/applications/passphrase/query/PassphraseCredentialQuery.php b/src/applications/passphrase/query/PassphraseCredentialQuery.php
--- a/src/applications/passphrase/query/PassphraseCredentialQuery.php
+++ b/src/applications/passphrase/query/PassphraseCredentialQuery.php
@@ -109,49 +109,49 @@
if ($this->ids !== null) {
$where[] = qsprintf(
$conn,
- 'id IN (%Ld)',
+ 'c.id IN (%Ld)',
$this->ids);
}
if ($this->phids !== null) {
$where[] = qsprintf(
$conn,
- 'phid IN (%Ls)',
+ 'c.phid IN (%Ls)',
$this->phids);
}
if ($this->credentialTypes !== null) {
$where[] = qsprintf(
$conn,
- 'credentialType in (%Ls)',
+ 'c.credentialType in (%Ls)',
$this->credentialTypes);
}
if ($this->providesTypes !== null) {
$where[] = qsprintf(
$conn,
- 'providesType IN (%Ls)',
+ 'c.providesType IN (%Ls)',
$this->providesTypes);
}
if ($this->isDestroyed !== null) {
$where[] = qsprintf(
$conn,
- 'isDestroyed = %d',
+ 'c.isDestroyed = %d',
(int)$this->isDestroyed);
}
if ($this->allowConduit !== null) {
$where[] = qsprintf(
$conn,
- 'allowConduit = %d',
+ 'c.allowConduit = %d',
(int)$this->allowConduit);
}
if (strlen($this->nameContains)) {
$where[] = qsprintf(
$conn,
- 'LOWER(name) LIKE %~',
+ 'LOWER(c.name) LIKE %~',
phutil_utf8_strtolower($this->nameContains));
}
@@ -162,4 +162,8 @@
return 'PhabricatorPassphraseApplication';
}
+ protected function getPrimaryTableAlias() {
+ return 'c';
+ }
+
}
diff --git a/src/applications/passphrase/search/PassphraseCredentialFerretEngine.php b/src/applications/passphrase/search/PassphraseCredentialFerretEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/passphrase/search/PassphraseCredentialFerretEngine.php
@@ -0,0 +1,22 @@
+<?php
+
+final class PassphraseCredentialFerretEngine
+ extends PhabricatorFerretEngine {
+
+ public function newNgramsObject() {
+ return new PassphraseCredentialFerretNgrams();
+ }
+
+ public function newDocumentObject() {
+ return new PassphraseCredentialFerretDocument();
+ }
+
+ public function newFieldObject() {
+ return new PassphraseCredentialFerretField();
+ }
+
+ public function newSearchEngine() {
+ return new PassphraseCredentialSearchEngine();
+ }
+
+}
diff --git a/src/applications/passphrase/storage/PassphraseCredential.php b/src/applications/passphrase/storage/PassphraseCredential.php
--- a/src/applications/passphrase/storage/PassphraseCredential.php
+++ b/src/applications/passphrase/storage/PassphraseCredential.php
@@ -8,7 +8,8 @@
PhabricatorSubscribableInterface,
PhabricatorDestructibleInterface,
PhabricatorSpacesInterface,
- PhabricatorFulltextInterface {
+ PhabricatorFulltextInterface,
+ PhabricatorFerretInterface {
protected $name;
protected $credentialType;
@@ -197,4 +198,12 @@
}
+/* -( PhabricatorFerretInterface )----------------------------------------- */
+
+
+ public function newFerretEngine() {
+ return new PassphraseCredentialFerretEngine();
+ }
+
+
}
diff --git a/src/applications/passphrase/storage/PassphraseCredentialFerretDocument.php b/src/applications/passphrase/storage/PassphraseCredentialFerretDocument.php
new file mode 100644
--- /dev/null
+++ b/src/applications/passphrase/storage/PassphraseCredentialFerretDocument.php
@@ -0,0 +1,14 @@
+<?php
+
+final class PassphraseCredentialFerretDocument
+ extends PhabricatorFerretDocument {
+
+ public function getApplicationName() {
+ return 'passphrase';
+ }
+
+ public function getIndexKey() {
+ return 'credential';
+ }
+
+}
diff --git a/src/applications/passphrase/storage/PassphraseCredentialFerretField.php b/src/applications/passphrase/storage/PassphraseCredentialFerretField.php
new file mode 100644
--- /dev/null
+++ b/src/applications/passphrase/storage/PassphraseCredentialFerretField.php
@@ -0,0 +1,14 @@
+<?php
+
+final class PassphraseCredentialFerretField
+ extends PhabricatorFerretField {
+
+ public function getApplicationName() {
+ return 'passphrase';
+ }
+
+ public function getIndexKey() {
+ return 'credential';
+ }
+
+}
diff --git a/src/applications/passphrase/storage/PassphraseCredentialFerretNgrams.php b/src/applications/passphrase/storage/PassphraseCredentialFerretNgrams.php
new file mode 100644
--- /dev/null
+++ b/src/applications/passphrase/storage/PassphraseCredentialFerretNgrams.php
@@ -0,0 +1,14 @@
+<?php
+
+final class PassphraseCredentialFerretNgrams
+ extends PhabricatorFerretNgrams {
+
+ public function getApplicationName() {
+ return 'passphrase';
+ }
+
+ public function getIndexKey() {
+ return 'credential';
+ }
+
+}

File Metadata

Mime Type
text/plain
Expires
Jun 9 2024, 5:22 AM (5 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6287173
Default Alt Text
D18556.id44592.diff (9 KB)

Event Timeline