Page MenuHomePhabricator

D17618.id42381.diff
No OneTemporary

D17618.id42381.diff

diff --git a/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php b/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
--- a/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
@@ -3,12 +3,21 @@
final class FileUploadHashConduitAPIMethod extends FileConduitAPIMethod {
public function getAPIMethodName() {
- // TODO: Deprecate this in favor of `file.allocate`.
return 'file.uploadhash';
}
+ public function getMethodStatus() {
+ return self::METHOD_STATUS_DEPRECATED;
+ }
+
+ public function getMethodStatusDescription() {
+ return pht(
+ 'This method is deprecated. Callers should use "file.allocate" '.
+ 'instead.');
+ }
+
public function getMethodDescription() {
- return pht('Upload a file to the server using content hash.');
+ return pht('Obsolete. Has no effect.');
}
protected function defineParamTypes() {
@@ -19,25 +28,11 @@
}
protected function defineReturnType() {
- return 'phid or null';
+ return 'null';
}
protected function execute(ConduitAPIRequest $request) {
- $hash = $request->getValue('hash');
- $name = $request->getValue('name');
- $user = $request->getUser();
-
- $file = PhabricatorFile::newFileFromContentHash(
- $hash,
- array(
- 'name' => $name,
- 'authorPHID' => $user->getPHID(),
- ));
-
- if ($file) {
- return $file->getPHID();
- }
- return $file;
+ return null;
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 3:47 PM (4 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309020
Default Alt Text
D17618.id42381.diff (1 KB)

Event Timeline