From 6f372943dbefea5995c75c20773785e164c94902 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 4 Sep 2015 10:34:32 -0700 Subject: [PATCH] Add support for temporary files to `file.allocate` Summary: Ref T7148. I can do most of the export stuff by only modifying the Instances codebase, but want to upload all the backups and exports as temporary files and can't currently do this via the API. Make the necessary API changes so that the export workflow can use them when it gets built out. Test Plan: See next diff. Uploaded files with `arc upload --temporary` and saw them upload as temporary files. Reviewers: chad Reviewed By: chad Maniphest Tasks: T7148 Differential Revision: https://secure.phabricator.com/D14055 --- resources/celerity/map.php | 6 +++--- .../files/conduit/FileAllocateConduitAPIMethod.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 21e60864f4..cc948cc4f5 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'a40c0b28', + 'core.pkg.css' => 'eb8c668d', 'core.pkg.js' => '47dc9ebb', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', @@ -138,7 +138,7 @@ return array( 'rsrc/css/phui/phui-info-view.css' => '5b16bac6', 'rsrc/css/phui/phui-list.css' => '125599df', 'rsrc/css/phui/phui-object-box.css' => '407eaf5a', - 'rsrc/css/phui/phui-object-item-list-view.css' => '26c30d3f', + 'rsrc/css/phui/phui-object-item-list-view.css' => 'ab1bf393', 'rsrc/css/phui/phui-pager.css' => 'bea33d23', 'rsrc/css/phui/phui-pinboard-view.css' => '2495140e', 'rsrc/css/phui/phui-property-list-view.css' => '03904f6b', @@ -791,7 +791,7 @@ return array( 'phui-inline-comment-view-css' => '0fdb3667', 'phui-list-view-css' => '125599df', 'phui-object-box-css' => '407eaf5a', - 'phui-object-item-list-view-css' => '26c30d3f', + 'phui-object-item-list-view-css' => 'ab1bf393', 'phui-pager-css' => 'bea33d23', 'phui-pinboard-view-css' => '2495140e', 'phui-property-list-view-css' => '03904f6b', diff --git a/src/applications/files/conduit/FileAllocateConduitAPIMethod.php b/src/applications/files/conduit/FileAllocateConduitAPIMethod.php index d21c26fe11..ff3a0c80da 100644 --- a/src/applications/files/conduit/FileAllocateConduitAPIMethod.php +++ b/src/applications/files/conduit/FileAllocateConduitAPIMethod.php @@ -17,6 +17,7 @@ final class FileAllocateConduitAPIMethod 'contentLength' => 'int', 'contentHash' => 'optional string', 'viewPolicy' => 'optional string', + 'deleteAfterEpoch' => 'optional int', ); } @@ -39,6 +40,11 @@ final class FileAllocateConduitAPIMethod 'isExplicitUpload' => true, ); + $ttl = $request->getValue('deleteAfterEpoch'); + if ($ttl) { + $properties['ttl'] = $ttl; + } + $file = null; if ($hash) { $file = PhabricatorFile::newFileFromContentHash( -- 2.51.2