Add 'paste.query' conduit method and deprecate 'paste.info'

Summary:
  - Modernize the Paste Conduit API.
  - Deprecate 'paste.info'.
  - Make queries policy-aware.
  - Move methods into the application to support greater modularity.

Test Plan: Made `paste.query`, `paste.info`, `paste.create` calls. Browsed Paste interfaces. Forked a paste.

Reviewers: vrana, btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3379
This commit is contained in:
epriestley
2012-08-24 13:20:20 -07:00
parent 85bf88e400
commit d814245eea
8 changed files with 145 additions and 23 deletions

View File

@@ -43,6 +43,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
$parent = id(new PhabricatorPasteQuery())
->setViewer($user)
->withIDs(array($parent_id))
->needContent(true)
->execute();
$parent = head($parent);
@@ -105,11 +106,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
if ($is_create && $parent) {
$paste->setTitle('Fork of '.$parent->getFullName());
$paste->setLanguage($parent->getLanguage());
$parent_file = id(new PhabricatorFile())->loadOneWhere(
'phid = %s',
$parent->getFilePHID());
$text = $parent_file->loadFileData();
$text = $parent->getContent();
}
}