Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15408920
D16600.id39960.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Referenced Files
None
Subscribers
None
D16600.id39960.diff
View Options
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
@@ -3187,6 +3187,7 @@
'PhabricatorPhurlURLAccessController' => 'applications/phurl/controller/PhabricatorPhurlURLAccessController.php',
'PhabricatorPhurlURLCommentController' => 'applications/phurl/controller/PhabricatorPhurlURLCommentController.php',
'PhabricatorPhurlURLCreateCapability' => 'applications/phurl/capability/PhabricatorPhurlURLCreateCapability.php',
+ 'PhabricatorPhurlURLEditConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php',
'PhabricatorPhurlURLEditController' => 'applications/phurl/controller/PhabricatorPhurlURLEditController.php',
'PhabricatorPhurlURLEditEngine' => 'applications/phurl/editor/PhabricatorPhurlURLEditEngine.php',
'PhabricatorPhurlURLEditor' => 'applications/phurl/editor/PhabricatorPhurlURLEditor.php',
@@ -3195,6 +3196,7 @@
'PhabricatorPhurlURLPHIDType' => 'applications/phurl/phid/PhabricatorPhurlURLPHIDType.php',
'PhabricatorPhurlURLQuery' => 'applications/phurl/query/PhabricatorPhurlURLQuery.php',
'PhabricatorPhurlURLReplyHandler' => 'applications/phurl/mail/PhabricatorPhurlURLReplyHandler.php',
+ 'PhabricatorPhurlURLSearchConduitAPIMethod' => 'applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php',
'PhabricatorPhurlURLSearchEngine' => 'applications/phurl/query/PhabricatorPhurlURLSearchEngine.php',
'PhabricatorPhurlURLTransaction' => 'applications/phurl/storage/PhabricatorPhurlURLTransaction.php',
'PhabricatorPhurlURLTransactionComment' => 'applications/phurl/storage/PhabricatorPhurlURLTransactionComment.php',
@@ -8104,10 +8106,12 @@
'PhabricatorMentionableInterface',
'PhabricatorFlaggableInterface',
'PhabricatorSpacesInterface',
+ 'PhabricatorConduitResultInterface',
),
'PhabricatorPhurlURLAccessController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLCommentController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLCreateCapability' => 'PhabricatorPolicyCapability',
+ 'PhabricatorPhurlURLEditConduitAPIMethod' => 'PhabricatorEditEngineAPIMethod',
'PhabricatorPhurlURLEditController' => 'PhabricatorPhurlController',
'PhabricatorPhurlURLEditEngine' => 'PhabricatorEditEngine',
'PhabricatorPhurlURLEditor' => 'PhabricatorApplicationTransactionEditor',
@@ -8116,6 +8120,7 @@
'PhabricatorPhurlURLPHIDType' => 'PhabricatorPHIDType',
'PhabricatorPhurlURLQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorPhurlURLReplyHandler' => 'PhabricatorApplicationTransactionReplyHandler',
+ 'PhabricatorPhurlURLSearchConduitAPIMethod' => 'PhabricatorSearchEngineAPIMethod',
'PhabricatorPhurlURLSearchEngine' => 'PhabricatorApplicationSearchEngine',
'PhabricatorPhurlURLTransaction' => 'PhabricatorApplicationTransaction',
'PhabricatorPhurlURLTransactionComment' => 'PhabricatorApplicationTransactionComment',
diff --git a/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php b/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phurl/conduit/PhabricatorPhurlURLEditConduitAPIMethod.php
@@ -0,0 +1,18 @@
+<?php
+
+final class PhabricatorPhurlURLEditConduitAPIMethod
+ extends PhabricatorEditEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'phurls.edit';
+ }
+
+ public function newEditEngine() {
+ return new PhabricatorPhurlURLEditEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht(
+ 'Apply transactions to create a new phurl URL or edit an existing one.');
+ }
+}
diff --git a/src/applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php b/src/applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php
new file mode 100644
--- /dev/null
+++ b/src/applications/phurl/conduit/PhabricatorPhurlURLSearchConduitAPIMethod.php
@@ -0,0 +1,18 @@
+<?php
+
+final class PhabricatorPhurlURLSearchConduitAPIMethod
+ extends PhabricatorSearchEngineAPIMethod {
+
+ public function getAPIMethodName() {
+ return 'phurls.search';
+ }
+
+ public function newSearchEngine() {
+ return new PhabricatorPhurlURLSearchEngine();
+ }
+
+ public function getMethodSummary() {
+ return pht('Read information about Phurl URLS.');
+ }
+
+}
diff --git a/src/applications/phurl/storage/PhabricatorPhurlURL.php b/src/applications/phurl/storage/PhabricatorPhurlURL.php
--- a/src/applications/phurl/storage/PhabricatorPhurlURL.php
+++ b/src/applications/phurl/storage/PhabricatorPhurlURL.php
@@ -9,7 +9,8 @@
PhabricatorDestructibleInterface,
PhabricatorMentionableInterface,
PhabricatorFlaggableInterface,
- PhabricatorSpacesInterface {
+ PhabricatorSpacesInterface,
+ PhabricatorConduitResultInterface {
protected $name;
protected $alias;
@@ -202,4 +203,41 @@
public function getSpacePHID() {
return $this->spacePHID;
}
+
+/* -( PhabricatorConduitResultInterface )---------------------------------- */
+
+
+ public function getFieldSpecificationsForConduit() {
+ return array(
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('name')
+ ->setType('string')
+ ->setDescription(pht('URL name.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('alias')
+ ->setType('string')
+ ->setDescription(pht('The alias for the URL.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('longurl')
+ ->setType('string')
+ ->setDescription(pht('The pre-shortened URL.')),
+ id(new PhabricatorConduitSearchFieldSpecification())
+ ->setKey('description')
+ ->setType('string')
+ ->setDescription(pht('A description of the URL.')),
+ );
+ }
+
+ public function getFieldValuesForConduit() {
+ return array(
+ 'name' => $this->getName(),
+ 'alias' => $this->getAlias(),
+ 'longurl' => $this->getLongURL(),
+ 'description' => $this->getDescription(),
+ );
+ }
+
+ public function getConduitSearchAttachments() {
+ return array();
+ }
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 2:12 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712362
Default Alt Text
D16600.id39960.diff (6 KB)
Attached To
Mode
D16600: Expose conduit API methods for Phurl URLs
Attached
Detach File
Event Timeline
Log In to Comment